use crt v3.24.9

This commit is contained in:
Jan Mercl
2020-07-31 14:18:38 +02:00
parent 3337c85b5e
commit 1349149922
14 changed files with 19576 additions and 17081 deletions

View File

@@ -90,8 +90,9 @@ func init() {
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\"")
recsPerSec = flag.Bool("recs_per_sec_as_mbps", false, "Show records per second as MB/s.")
oRecsPerSec = flag.Bool("recs_per_sec_as_mbps", false, "Show records per second as MB/s.")
)
func TestMain(m *testing.M) {
@@ -268,7 +269,7 @@ func BenchmarkInsertMemory(b *testing.B) {
}
}
b.StopTimer()
if *recsPerSec {
if *oRecsPerSec {
b.SetBytes(1e6)
}
if _, err := db.Exec(`commit;`); err != nil {
@@ -323,7 +324,7 @@ func BenchmarkNextMemory(b *testing.B) {
}
}
b.StopTimer()
if *recsPerSec {
if *oRecsPerSec {
b.SetBytes(1e6)
}
}
@@ -787,10 +788,15 @@ func TestNoRows(t *testing.T) {
}
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",
@@ -814,10 +820,6 @@ func TestTclTest(t *testing.T) {
//TODO exits tests
"index.test",
//TODO hangs
"corruptL.test",
"gencol1.test",
//TODO OOM
"csv01.test",
}

View File

@@ -24,23 +24,34 @@ var (
config = []string{
"-DHAVE_USLEEP",
"-DLONGDOUBLE_TYPE=double",
"-DNDEBUG",
"-DSQLITE_CORE", // testfixture
"-DSQLITE_DEFAULT_MEMSTATUS=0",
"-DSQLITE_DEFAULT_PAGE_SIZE=1024", // Needed by testfixture, where it's sadly hardcoded. See file_pages in autovacuum.test.
"-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_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_OMIT_PROGRESS_CALLBACK",
"-DSQLITE_OMIT_UTF16",
"-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_TEST",
"-DSQLITE_THREADSAFE=2", // Multi-thread
"-DSQLITE_THREADSAFE=1",
"-ccgo-long-double-is-double",
// "-DSQLITE_OMIT_DECLTYPE", // testfixture needs this
// "-DSQLITE_OMIT_DEPRECATED", // mptest needs deprecated sqlite3_trace.
// "-DSQLITE_OMIT_LOAD_EXTENSION", // mptest needs this
// "-DSQLITE_OMIT_DECLTYPE", // testfixture
// "-DSQLITE_OMIT_DEPRECATED", // mptest
// "-DSQLITE_OMIT_LOAD_EXTENSION", // mptest
// "-DSQLITE_OMIT_SHARED_CACHE",
// "-DSQLITE_USE_ALLOCA",
//TODO "-DHAVE_MALLOC_USABLE_SIZE"
@@ -253,14 +264,14 @@ func makeTestfixture() {
append(
[]string{
"-DSQLITE_OMIT_LOAD_EXTENSION",
"-DTCLSH",
"-DTCLSH_INIT_PROC=sqlite3TestInit",
"-I/usr/include/tcl8.6",
"-ccgo-export-defines", "",
"-ccgo-export-fields", "F",
"-ccgo-pkgname", "testfixture",
//TODO- "-ccgo-watch-instrumentation", //TODO-
"-l", "modernc.org/tcl/lib,modernc.org/sqlite/internal/crt2,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"),
@@ -285,6 +296,7 @@ func makeTestfixture() {
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"),
@@ -323,6 +335,7 @@ func makeTestfixture() {
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"),
@@ -333,7 +346,6 @@ func makeTestfixture() {
filepath.Join(sqliteSrcDir, "src", "test_window.c"),
fmt.Sprintf("-I%s", sqliteDir),
fmt.Sprintf("-I%s", sqliteSrcDir),
"-l", "modernc.org/tcl/lib,modernc.org/sqlite/internal/crt2,modernc.org/sqlite/lib",
},
config...)...,
)

4
go.mod
View File

@@ -3,7 +3,7 @@ module modernc.org/sqlite
go 1.14
require (
modernc.org/crt/v3 v3.24.8
modernc.org/crt/v3 v3.24.9
modernc.org/mathutil v1.0.0
modernc.org/tcl v1.0.1-beta1
modernc.org/tcl v1.0.2-beta1
)

10
go.sum
View File

@@ -5,15 +5,13 @@ github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uY
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/crt/v3 v3.24.6 h1:GKQR9pBq9kutl8jxlWXux78XZ53b8AQI/1w2K5Me2Pw=
modernc.org/crt/v3 v3.24.6/go.mod h1:jZ0M2dvOLID7IgZPGZ189WFLj+m5qEACQm84BoFsHF4=
modernc.org/crt/v3 v3.24.8 h1:zgcSVZQvN1k1xqsJS2q4QDA43Wx4dYXpWuhYeDupmh8=
modernc.org/crt/v3 v3.24.8/go.mod h1:jZ0M2dvOLID7IgZPGZ189WFLj+m5qEACQm84BoFsHF4=
modernc.org/crt/v3 v3.24.9 h1:5MjFsqlZG6MXMv1jHCXCoj5JJw/nSIWTGOuwQ2+9+Q8=
modernc.org/crt/v3 v3.24.9/go.mod h1:jZ0M2dvOLID7IgZPGZ189WFLj+m5qEACQm84BoFsHF4=
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/memory v1.0.0 h1:Tm1p6vBp/U/SGR9/EeFhMvGzaVpUWeePopZhhIpW2YE=
modernc.org/memory v1.0.0/go.mod h1:TXr4iJDvK3g0hW+sV+Kohu7BoeHfqw7QEFZWkBExdZc=
modernc.org/tcl v1.0.1-beta1 h1:gbu1D0lSgqGopA6exJBYQss2CfpgdiKy8GzCYQUGqfE=
modernc.org/tcl v1.0.1-beta1/go.mod h1:y63wARnVYP+cPK5skKN9IpuZW6VYCdciAPSk8mVWNAY=
modernc.org/tcl v1.0.2-beta1 h1:N3+I7wZty38v0YLtqvo67dB9BXwg6Olj06RKnfRbwmw=
modernc.org/tcl v1.0.2-beta1/go.mod h1:0jP6/jsOek3IAOdy2FR7lZ0tFhb0n1pPHUT24I+nRF0=

View File

@@ -7,8 +7,7 @@ package crt2 // import "modernc.org/sqlite/internal/crt2"
var CAPI = map[string]struct{}{
"ferror": {},
"fstat": {},
// "ftruncate": {},
// "lstat": {},
"pthread_cond_broadcast": {},
"pthread_cond_destroy": {},
"pthread_cond_init": {},
"pthread_cond_signal": {},
@@ -18,117 +17,7 @@ var CAPI = map[string]struct{}{
"pthread_mutex_destroy": {},
"pthread_mutex_init": {},
"pthread_mutex_lock": {},
"pthread_mutex_trylock": {},
"pthread_mutex_unlock": {},
// "readdir": {},
// "rename": {},
"sched_yield": {},
// "stat": {},
//
// "__assert_fail": {},
// "__builtin_exit": {},
// "__builtin_trap": {},
// "__builtin_unreachable": {},
// "abort": {},
// "calloc": {},
// "exit": {},
// "free": {},
// "malloc": {},
// "realloc": {},
//
// "TclFreeObj": {},
// "Tcl_Alloc": {},
// "Tcl_AppendElement": {},
// "Tcl_AppendObjToObj": {},
// "Tcl_AppendResult": {},
// "Tcl_AppendStringsToObj": {},
// "Tcl_AttemptAlloc": {},
// "Tcl_AttemptRealloc": {},
// "Tcl_BackgroundError": {},
// "Tcl_CreateChannel": {},
// "Tcl_CreateCommand": {},
// "Tcl_CreateInterp": {},
// "Tcl_CreateObjCommand": {},
// "Tcl_CreateThread": {},
// "Tcl_DStringAppend": {},
// "Tcl_DStringAppendElement": {},
// "Tcl_DStringFree": {},
// "Tcl_DStringInit": {},
// "Tcl_DeleteCommand": {},
// "Tcl_DeleteHashTable": {},
// "Tcl_DeleteInterp": {},
// "Tcl_DoOneEvent": {},
// "Tcl_DuplicateObj": {},
// "Tcl_Eval": {},
// "Tcl_EvalEx": {},
// "Tcl_EvalObjEx": {},
// "Tcl_ExitThread": {},
// "Tcl_FindExecutable": {},
// "Tcl_FirstHashEntry": {},
// "Tcl_Flush": {},
// "Tcl_Free": {},
// "Tcl_GetBoolean": {},
// "Tcl_GetBooleanFromObj": {},
// "Tcl_GetByteArrayFromObj": {},
// "Tcl_GetChannel": {},
// "Tcl_GetChannelInstanceData": {},
// "Tcl_GetChannelName": {},
// "Tcl_GetCharLength": {},
// "Tcl_GetCommandInfo": {},
// "Tcl_GetCurrentThread": {},
// "Tcl_GetDouble": {},
// "Tcl_GetDoubleFromObj": {},
// "Tcl_GetIndexFromObjStruct": {},
// "Tcl_GetInt": {},
// "Tcl_GetIntFromObj": {},
// "Tcl_GetObjResult": {},
// "Tcl_GetSlave": {},
// "Tcl_GetString": {},
// "Tcl_GetStringFromObj": {},
// "Tcl_GetStringResult": {},
// "Tcl_GetTime": {},
// "Tcl_GetVar2": {},
// "Tcl_GetVar2Ex": {},
// "Tcl_GetVersion": {},
// "Tcl_GetWideIntFromObj": {},
// "Tcl_GlobalEval": {},
// "Tcl_InitHashTable": {},
// "Tcl_LinkVar": {},
// "Tcl_ListObjAppendElement": {},
// "Tcl_ListObjGetElements": {},
// "Tcl_ListObjIndex": {},
// "Tcl_ListObjLength": {},
// "Tcl_NRAddCallback": {},
// "Tcl_NRCallObjProc": {},
// "Tcl_NRCreateCommand": {},
// "Tcl_NREvalObj": {},
// "Tcl_NewByteArrayObj": {},
// "Tcl_NewDoubleObj": {},
// "Tcl_NewIntObj": {},
// "Tcl_NewListObj": {},
// "Tcl_NewObj": {},
// "Tcl_NewStringObj": {},
// "Tcl_NewWideIntObj": {},
// "Tcl_NextHashEntry": {},
// "Tcl_ObjGetVar2": {},
// "Tcl_ObjSetVar2": {},
// "Tcl_Panic": {},
// "Tcl_PkgProvideEx": {},
// "Tcl_RegisterChannel": {},
// "Tcl_ResetResult": {},
// "Tcl_Seek": {},
// "Tcl_SetCommandInfo": {},
// "Tcl_SetIntObj": {},
// "Tcl_SetObjResult": {},
// "Tcl_SetResult": {},
// "Tcl_SetSystemEncoding": {},
// "Tcl_SetVar2": {},
// "Tcl_SetWideIntObj": {},
// "Tcl_ThreadAlert": {},
// "Tcl_ThreadQueueEvent": {},
// "Tcl_TranslateFileName": {},
// "Tcl_UnregisterChannel": {},
// "Tcl_UnsetVar2": {},
// "Tcl_UtfToLower": {},
// "Tcl_VarEval": {},
// "Tcl_WrongNumArgs": {},
}

130
internal/crt2/crt2.go Normal file
View File

@@ -0,0 +1,130 @@
// 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 crt2 // import "modernc.org/sqlite/internal/crt2"
import (
"fmt"
"os"
"runtime"
"strings"
"modernc.org/crt/v3"
)
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...)
}
pc, fn, fl, _ := runtime.Caller(1)
f := runtime.FuncForPC(pc)
var fns string
if f != nil {
fns = f.Name()
if x := strings.LastIndex(fns, "."); x > 0 {
fns = fns[x+1:]
}
}
r := fmt.Sprintf("%s:%d:%s: TODOTODO %s", fn, fl, fns, 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...)
}
_, fn, fl, _ := runtime.Caller(1)
r := fmt.Sprintf("\n%s:%d: TRC %s", fn, fl, s)
fmt.Fprintf(os.Stdout, "%s\n", r)
os.Stdout.Sync()
return r
}
// int sched_yield(void);
func Xsched_yield(tls *crt.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 {
panic(todo(""))
}
// int pthread_detach(pthread_t thread);
func Xpthread_detach(tls *crt.TLS, thread crt.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 {
panic(todo(""))
}
// int pthread_cond_signal(pthread_cond_t *cond);
func Xpthread_cond_signal(tls *crt.TLS, cond uintptr) int32 {
panic(todo(""))
}
// int pthread_mutex_unlock(pthread_mutex_t *mutex);
func Xpthread_mutex_unlock(tls *crt.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 {
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 {
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 {
panic(todo(""))
}
// int pthread_cond_destroy(pthread_cond_t *cond);
func Xpthread_cond_destroy(tls *crt.TLS, cond uintptr) int32 {
panic(todo(""))
}
// int pthread_mutex_destroy(pthread_mutex_t *mutex);
func Xpthread_mutex_destroy(tls *crt.TLS, mutex uintptr) int32 {
panic(todo(""))
}
// int pthread_mutex_trylock(pthread_mutex_t *mutex);
func Xpthread_mutex_trylock(tls *crt.TLS, mutex uintptr) int32 {
panic(todo(""))
}
// int pthread_cond_broadcast(pthread_cond_t *cond);
func Xpthread_cond_broadcast(tls *crt.TLS, cond uintptr) int32 {
panic(todo(""))
}

View File

@@ -1,929 +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 crt2 // import "modernc.org/sqlite/internal/crt2"
import (
"fmt"
"os"
"runtime"
"strings"
"modernc.org/crt/v3"
)
// const (
// TCL_GLOBAL_ONLY = 1
// )
//
// var (
// fToken uint64
// nameOfExecutable string
// objects = map[uintptr]objectNfo{}
// objectsMu sync.Mutex
// )
//
// func nextToken() uintptr { return uintptr(atomic.AddUint64(&fToken, 1)) }
//
// type objectNfo struct {
// memcheckerNfo
// value interface{}
// }
//
// func addObject(o interface{}) uintptr {
// var v objectNfo
// v.value = o
// v.object = o
// v.pc, v.file, v.line, v.ok = runtime.Caller(1)
// h := nextToken()
// objectsMu.Lock()
// objects[h] = v
// objectsMu.Unlock()
// return h
// }
//
// func getObject(h uintptr) interface{} {
// if h <= 0 {
// panic(todo(""))
// }
//
// objectsMu.Lock()
// v, ok := objects[h]
// if !ok {
// panic(todo("", h))
// }
//
// objectsMu.Unlock()
// return v.value
// }
//
// func removeObject(h uintptr) {
// if h <= 0 {
// panic(todo(""))
// }
//
// objectsMu.Lock()
// if _, ok := objects[h]; !ok {
// panic(todo(""))
// }
//
// delete(objects, h)
// objectsMu.Unlock()
// }
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...)
}
pc, fn, fl, _ := runtime.Caller(1)
f := runtime.FuncForPC(pc)
var fns string
if f != nil {
fns = f.Name()
if x := strings.LastIndex(fns, "."); x > 0 {
fns = fns[x+1:]
}
}
r := fmt.Sprintf("%s:%d:%s: TODOTODO %s", fn, fl, fns, 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...)
}
_, fn, fl, _ := runtime.Caller(1)
r := fmt.Sprintf("\n%s:%d: TRC %s", fn, fl, s)
fmt.Fprintf(os.Stdout, "%s\n", r)
os.Stdout.Sync()
return r
}
// int sched_yield(void);
func Xsched_yield(tls *crt.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 {
panic(todo(""))
}
// int pthread_detach(pthread_t thread);
func Xpthread_detach(tls *crt.TLS, thread crt.Size_t) int32 {
panic(todo(""))
}
// int ferror(FILE *stream);
func Xferror(tls *crt.TLS, stream uintptr) int32 {
panic(todo(""))
}
// // int ftruncate(int fd, off_t length);
// func Xftruncate(tls *crt.TLS, fd int32, length crt.Ssize_t) 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 {
panic(todo(""))
}
// int pthread_cond_signal(pthread_cond_t *cond);
func Xpthread_cond_signal(tls *crt.TLS, cond uintptr) int32 {
panic(todo(""))
}
// int pthread_mutex_unlock(pthread_mutex_t *mutex);
func Xpthread_mutex_unlock(tls *crt.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 {
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 {
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 {
panic(todo(""))
}
// int pthread_cond_destroy(pthread_cond_t *cond);
func Xpthread_cond_destroy(tls *crt.TLS, cond uintptr) int32 {
panic(todo(""))
}
// // int stat(const char *pathname, struct stat *statbuf);
// func Xstat(tls *crt.TLS, pathname, statbuf uintptr) int32 {
// panic(todo(""))
// }
//
// // int lstat(const char *pathname, struct stat *statbuf);
// func Xlstat(tls *crt.TLS, pathname, statbuf uintptr) int32 {
// panic(todo(""))
// }
//
// // struct dirent *readdir(DIR *dirp);
// func Xreaddir(tls *crt.TLS, dirp uintptr) uintptr {
// panic(todo(""))
// }
// int pthread_mutex_destroy(pthread_mutex_t *mutex);
func Xpthread_mutex_destroy(tls *crt.TLS, mutex uintptr) int32 {
panic(todo(""))
}
// // ============================================================================
//
// // void *malloc(size_t size);
// func Xmalloc(tls *crt.TLS, size crt.Size_t) uintptr {
// p := crt.Xmalloc(tls, size)
// if p != 0 {
// Memcheck.add(p, size)
// }
// return p
// }
//
// // void *calloc(size_t nmemb, size_t size);
// func Xcalloc(tls *crt.TLS, n, size crt.Size_t) uintptr {
// p := crt.Xcalloc(tls, n, size)
// if p != 0 {
// Memcheck.add(p, n*size)
// }
// return p
// }
//
// // void *realloc(void *ptr, size_t size);
// func Xrealloc(tls *crt.TLS, ptr uintptr, size crt.Size_t) uintptr {
// panic(todo(""))
// }
//
// // void free(void *ptr);
// func Xfree(tls *crt.TLS, ptr uintptr) {
// if ptr != 0 {
// Memcheck.remove(ptr)
// }
// crt.Xfree(tls, ptr)
// }
//
// // void abort(void);
// func Xabort(tls *crt.TLS) {
// Xexit(tls, 1)
// }
//
// // void exit(int status);
// func Xexit(tls *crt.TLS, status int32) {
// s := Memcheck.Audit()
// //trc("Memcheck.Audit(): %s", s)
// if s != "" && status == 0 {
// status = 1
// }
// fmt.Fprintln(os.Stderr, s)
// os.Stderr.Sync()
// crt.Xexit(tls, status)
// }
//
// func X__builtin_exit(tls *crt.TLS, status int32) { Xexit(tls, status) }
//
// // void __assert_fail(const char * assertion, const char * file, unsigned int line, const char * function);
// func X__assert_fail(tls *crt.TLS, assertion, file uintptr, line uint32, function uintptr) {
// fmt.Fprintf(os.Stderr, "assertion failure: %s:%d.%s: %s\n", crt.GoString(file), line, crt.GoString(function), crt.GoString(assertion))
// os.Stderr.Sync()
// Xexit(tls, 1)
// }
//
// // void __builtin_trap (void)
// func X__builtin_trap(tls *crt.TLS) {
// fmt.Fprintf(os.Stderr, "%s\ntrap\n", debug.Stack())
// os.Stderr.Sync()
// Xexit(tls, 1)
// }
//
// // void __builtin_unreachable (void)
// func X__builtin_unreachable(tls *crt.TLS) {
// fmt.Fprintf(os.Stderr, "%s\nunrechable\n", debug.Stack())
// os.Stderr.Sync()
// Xexit(tls, 1)
// }
//
// // ============================================================================
//
// // int Tcl_UnregisterChannel(Tcl_Interp *interp, Tcl_Channel chan);
// func XTcl_UnregisterChannel(tls *crt.TLS, interp, chan1 uintptr) int32 {
// panic(todo(""))
// }
//
// // void Tcl_Free(char *ptr);
// func XTcl_Free(tls *crt.TLS, ptr uintptr) {
// panic(todo(""))
// }
//
// // char * Tcl_Alloc(unsigned int size);
// func XTcl_Alloc(tls *crt.TLS, size uint32) uintptr {
// panic(todo(""))
// }
//
// // Tcl_Channel Tcl_CreateChannel(const Tcl_ChannelType *typePtr, const char *chanName, ClientData instanceData, int mask);
// func XTcl_CreateChannel(tls *crt.TLS, typePtr, chanName, instanceData uintptr, mask int32) uintptr {
// panic(todo(""))
// }
//
// // const char * Tcl_GetChannelName(Tcl_Channel chan);
// func XTcl_GetChannelName(tls *crt.TLS, chan1 uintptr) uintptr {
// panic(todo(""))
// }
//
// // char * Tcl_GetStringFromObj(Tcl_Obj *objPtr, int *lengthPtr);
// func XTcl_GetStringFromObj(tls *crt.TLS, objPtr, lengthPtr uintptr) uintptr {
// panic(todo(""))
// }
//
// // void Tcl_RegisterChannel(Tcl_Interp *interp, Tcl_Channel chan);
// func XTcl_RegisterChannel(tls *crt.TLS, interp, chan1 uintptr) {
// panic(todo(""))
// }
//
// // void Tcl_SetResult(Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc);
// func XTcl_SetResult(tls *crt.TLS, interp, result, freeProc uintptr) {
// panic(todo(""))
// }
//
// // void TclFreeObj(Tcl_Obj *objPtr);
// func XTclFreeObj(tls *crt.TLS, objPtr uintptr) {
// panic(todo(""))
// }
//
// // void Tcl_AppendResult(Tcl_Interp *interp, ...);
// func XTcl_AppendResult(tls *crt.TLS, interp, va uintptr) {
// panic(todo(""))
// }
//
// // void Tcl_BackgroundError(Tcl_Interp *interp);
// func XTcl_BackgroundError(tls *crt.TLS, interp uintptr) { panic(todo("")) }
//
// // Tcl_CreateInterp creates a new interpreter structure and returns a token for
// // it. The token is required in calls to most other Tcl procedures, such as
// // Tcl_CreateCommand, Tcl_Eval, and Tcl_DeleteInterp. The token returned by
// // Tcl_CreateInterp may only be passed to Tcl routines called from the same
// // thread as the original Tcl_CreateInterp call. It is not safe for multiple
// // threads to pass the same token to Tcl's routines. The new interpreter is
// // initialized with the built-in Tcl commands and with standard variables like
// // tcl_platform and env. To bind in additional commands, call
// // Tcl_CreateCommand, and to create additional variables, call Tcl_SetVar.
// //
// // Tcl_Interp * Tcl_CreateInterp(void);
// func XTcl_CreateInterp(tls *crt.TLS) uintptr {
// ctx := tee.NewContext("", false)
// if err := registerBuiltinCommands(ctx); err != nil {
// panic(todo("", err))
// }
//
// return addObject(ctx)
// }
//
// // Tcl_CreateObjCommand defines a new command in interp and associates it with
// // procedure proc such that whenever name is invoked as a Tcl command (e.g.,
// // via a call to Tcl_EvalObjEx) the Tcl interpreter will call proc to process
// // the command.
// //
// // Tcl_CreateObjCommand deletes any existing command name already associated
// // with the interpreter (however see below for an exception where the existing
// // command is not deleted). It returns a token that may be used to refer to the
// // command in subsequent calls to Tcl_GetCommandName. If name contains any ::
// // namespace qualifiers, then the command is added to the specified namespace;
// // otherwise the command is added to the global namespace. If
// // Tcl_CreateObjCommand is called for an interpreter that is in the process of
// // being deleted, then it does not create a new command and it returns NULL.
// // proc should have arguments and result that match the type Tcl_ObjCmdProc:
// //
// // typedef int Tcl_ObjCmdProc(
// // ClientData clientData,
// // Tcl_Interp *interp,
// // int objc,
// // Tcl_Obj *const objv[]);
// //
// // When proc is invoked, the clientData and interp parameters will be copies of
// // the clientData and interp arguments given to Tcl_CreateObjCommand.
// // Typically, clientData points to an application-specific data structure that
// // describes what to do when the command procedure is invoked. Objc and objv
// // describe the arguments to the command, objc giving the number of argument
// // values (including the command name) and objv giving the values of the
// // arguments. The objv array will contain objc values, pointing to the argument
// // values. Unlike argv[argv] used in a string-based command procedure,
// // objv[objc] will not contain NULL.
// //
// // Additionally, when proc is invoked, it must not modify the contents of the
// // objv array by assigning new pointer values to any element of the array (for
// // example, objv[2] = NULL) because this will cause memory to be lost and the
// // runtime stack to be corrupted. The const in the declaration of objv will
// // cause ANSI-compliant compilers to report any such attempted assignment as an
// // error. However, it is acceptable to modify the internal representation of
// // any individual value argument. For instance, the user may call
// // Tcl_GetIntFromObj on objv[2] to obtain the integer representation of that
// // value; that call may change the type of the value that objv[2] points at,
// // but will not change where objv[2] points.
// //
// // proc must return an integer code that is either TCL_OK, TCL_ERROR,
// // TCL_RETURN, TCL_BREAK, or TCL_CONTINUE. See the Tcl overview man page for
// // details on what these codes mean. Most normal commands will only return
// // TCL_OK or TCL_ERROR. In addition, if proc needs to return a non-empty
// // result, it can call Tcl_SetObjResult to set the interpreter's result. In the
// // case of a TCL_OK return code this gives the result of the command, and in
// // the case of TCL_ERROR this gives an error message. Before invoking a command
// // procedure, Tcl_EvalObjEx sets interpreter's result to point to a value
// // representing an empty string, so simple commands can return an empty result
// // by doing nothing at all.
// //
// // The contents of the objv array belong to Tcl and are not guaranteed to
// // persist once proc returns: proc should not modify them. Call
// // Tcl_SetObjResult if you want to return something from the objv array.
// //
// // Ordinarily, Tcl_CreateObjCommand deletes any existing command name already
// // associated with the interpreter. However, if the existing command was
// // created by a previous call to Tcl_CreateCommand, Tcl_CreateObjCommand does
// // not delete the command but instead arranges for the Tcl interpreter to call
// // the Tcl_ObjCmdProc proc in the future. The old string-based Tcl_CmdProc
// // associated with the command is retained and its address can be obtained by
// // subsequent Tcl_GetCommandInfo calls. This is done for backwards
// // compatibility.
// //
// // DeleteProc will be invoked when (if) name is deleted. This can occur through
// // a call to Tcl_DeleteCommand, Tcl_DeleteCommandFromToken, or
// // Tcl_DeleteInterp, or by replacing name in another call to
// // Tcl_CreateObjCommand. DeleteProc is invoked before the command is deleted,
// // and gives the application an opportunity to release any structures
// // associated with the command. DeleteProc should have arguments and result
// // that match the type Tcl_CmdDeleteProc:
// //
// // typedef void Tcl_CmdDeleteProc(
// // ClientData clientData);
// //
// // The clientData argument will be the same as the clientData argument passed
// // to Tcl_CreateObjCommand.
// //
// // Tcl_Command Tcl_CreateObjCommand(Tcl_Interp *interp, const char *cmdName, Tcl_ObjCmdProc *proc, ClientData clientData, Tcl_CmdDeleteProc *deleteProc);
// func XTcl_CreateObjCommand(tls *crt.TLS, interp, cmdName0, proc, clientData, deleteProc uintptr) uintptr {
// ctx := getObject(interp).(*tee.Context)
// if ctx.BeingDeleted {
// return 0
// }
//
// cmdName := crt.GoString(cmdName0)
// cmd, rc := ctx.Proc(
// tee.NewString(cmdName), tee.NewNoValue(), tee.NewNoValue(),
// func(ctx *tee.Context, values ...tee.Value) tee.ReturnCode {
// panic(todo(""))
// },
// func(cmd *tee.Command) error {
// panic(todo(""))
// },
// clientData,
// )
// if rc != tee.Ok {
// panic(todo(""))
// }
//
// return addObject(cmd)
// }
//
// // char * Tcl_DStringAppend(Tcl_DString *dsPtr, const char *bytes, int length);
// func XTcl_DStringAppend(tls *crt.TLS, dsPtr, bytes uintptr, length int32) uintptr { panic(todo("")) }
//
// // char * Tcl_DStringAppendElement(Tcl_DString *dsPtr, const char *element);
// func XTcl_DStringAppendElement(tls *crt.TLS, dsPtr, element uintptr) uintptr { panic(todo("")) }
//
// // void Tcl_DStringFree(Tcl_DString *dsPtr);
// func XTcl_DStringFree(tls *crt.TLS, dsPtr uintptr) { panic(todo("")) }
//
// // void Tcl_DStringInit(Tcl_DString *dsPtr);
// func XTcl_DStringInit(tls *crt.TLS, dsPtr uintptr) { panic(todo("")) }
//
// // int Tcl_DeleteCommand(Tcl_Interp *interp, const char *cmdName);
// func XTcl_DeleteCommand(tls *crt.TLS, interp, cmdName uintptr) int32 { panic(todo("")) }
//
// // Tcl_Obj * Tcl_DuplicateObj(Tcl_Obj *objPtr);
// func XTcl_DuplicateObj(tls *crt.TLS, objPtr uintptr) uintptr { panic(todo("")) }
//
// // int Tcl_Eval(Tcl_Interp *interp, const char *script);
// func XTcl_Eval(tls *crt.TLS, interp, script uintptr) int32 { panic(todo("")) }
//
// // int Tcl_EvalObjEx(Tcl_Interp *interp, Tcl_Obj *objPtr, int flags);
// func XTcl_EvalObjEx(tls *crt.TLS, interp, objPtr uintptr, flags int32) int32 { panic(todo("")) }
//
// // void Tcl_FindExecutable(const char *argv0);
// func XTcl_FindExecutable(tls *crt.TLS, argv00 uintptr) {
// argv0 := crt.GoString(argv00)
// if filepath.IsAbs(argv0) {
// nameOfExecutable = argv0
// return
// }
//
// argv0, err := exec.LookPath(argv0)
// if err != nil {
// return
// }
//
// if argv0, err = filepath.Abs(argv0); err != nil {
// return
// }
//
// nameOfExecutable = argv0
// }
//
// // int Tcl_GetBooleanFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *boolPtr);
// func XTcl_GetBooleanFromObj(tls *crt.TLS, interp, objPtr, boolPtr uintptr) int32 { panic(todo("")) }
//
// // unsigned char * Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr, int *lengthPtr);
// func XTcl_GetByteArrayFromObj(tls *crt.TLS, objPtr, lengthPtr uintptr) uintptr { panic(todo("")) }
//
// // int Tcl_GetCharLength(Tcl_Obj *objPtr);
// func XTcl_GetCharLength(tls *crt.TLS, objPtr uintptr) int32 { panic(todo("")) }
//
// // int Tcl_GetDoubleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, double *doublePtr);
// func XTcl_GetDoubleFromObj(tls *crt.TLS, interp, objPtr, doublePtr uintptr) int32 { panic(todo("")) }
//
// // int Tcl_GetIndexFromObjStruct(Tcl_Interp *interp, Tcl_Obj *objPtr, const void *tablePtr, int offset, const char *msg, int flags, int *indexPtr);
// func XTcl_GetIndexFromObjStruct(tls *crt.TLS, interp, objPtr, tablePtr uintptr, offset int32, msg uintptr, flags int32, indexPtr uintptr) int32 {
// panic(todo(""))
// }
//
// // int Tcl_GetIntFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *intPtr);
// func XTcl_GetIntFromObj(tls *crt.TLS, interp, objPtr, intPtr uintptr) int32 { panic(todo("")) }
//
// // Tcl_Obj * Tcl_GetObjResult(Tcl_Interp *interp);
// func XTcl_GetObjResult(tls *crt.TLS, interp uintptr) uintptr { panic(todo("")) }
//
// // char * Tcl_GetString(Tcl_Obj *objPtr);
// func XTcl_GetString(tls *crt.TLS, objPtr uintptr) uintptr { panic(todo("")) }
//
// // const char * Tcl_GetStringResult(Tcl_Interp *interp);
// func XTcl_GetStringResult(tls *crt.TLS, interp uintptr) uintptr { panic(todo("")) }
//
// // const char * Tcl_GetVar2(Tcl_Interp *interp, const char *part1, const char *part2, int flags);
// func XTcl_GetVar2(tls *crt.TLS, interp, part1, part2 uintptr, flags int32) uintptr { panic(todo("")) }
//
// // Tcl_Obj * Tcl_GetVar2Ex(Tcl_Interp *interp, const char *part1, const char *part2, int flags);
// func XTcl_GetVar2Ex(tls *crt.TLS, interp, part1, part2 uintptr, flags int32) uintptr { panic(todo("")) }
//
// // void Tcl_GetVersion(int *major, int *minor, int *patchLevel, int *type);
// func XTcl_GetVersion(tls *crt.TLS, major, minor, patchLevel, type1 uintptr) { panic(todo("")) }
//
// // int Tcl_GetWideIntFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_WideInt *widePtr);
// func XTcl_GetWideIntFromObj(tls *crt.TLS, interp, objPtr, widePtr uintptr) int32 { panic(todo("")) }
//
// // int Tcl_GlobalEval(Tcl_Interp *interp, const char *command);
// func XTcl_GlobalEval(tls *crt.TLS, interp, command uintptr) int32 { panic(todo("")) }
//
// // int Tcl_ListObjAppendElement(Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Obj *objPtr);
// func XTcl_ListObjAppendElement(tls *crt.TLS, interp, listPtr, objPtr uintptr) int32 { panic(todo("")) }
//
// // int Tcl_ListObjGetElements(Tcl_Interp *interp, Tcl_Obj *listPtr, int *objcPtr, Tcl_Obj ***objvPtr);
// func XTcl_ListObjGetElements(tls *crt.TLS, interp, listPtr, objcPtr, objvPtr uintptr) int32 {
// panic(todo(""))
// }
//
// // int Tcl_ListObjIndex(Tcl_Interp *interp, Tcl_Obj *listPtr, int index, Tcl_Obj **objPtrPtr);
// func XTcl_ListObjIndex(tls *crt.TLS, interp, listPtr uintptr, index int32, objPtrPtr uintptr) int32 {
// panic(todo(""))
// }
//
// // int Tcl_ListObjLength(Tcl_Interp *interp, Tcl_Obj *listPtr, int *lengthPtr);
// func XTcl_ListObjLength(tls *crt.TLS, interp, listPtr, lengthPtr uintptr) int32 { panic(todo("")) }
//
// // void Tcl_NRAddCallback(Tcl_Interp *interp, Tcl_NRPostProc *postProcPtr, ClientData data0, ClientData data1, ClientData data2, ClientData data3);
// func XTcl_NRAddCallback(tls *crt.TLS, interp, postProcPtr, data0, data1, data2, data3 uintptr) {
// panic(todo(""))
// }
//
// // int Tcl_NRCallObjProc(Tcl_Interp *interp, Tcl_ObjCmdProc *objProc, ClientData clientData, int objc, Tcl_Obj *const objv[]);
// func XTcl_NRCallObjProc(tls *crt.TLS, interp, objProc, clientData uintptr, objc int32, objv uintptr) int32 {
// panic(todo(""))
// }
//
// // Tcl_Command Tcl_NRCreateCommand(Tcl_Interp *interp, const char *cmdName, Tcl_ObjCmdProc *proc, Tcl_ObjCmdProc *nreProc, ClientData clientData, Tcl_CmdDeleteProc *deleteProc);
// func XTcl_NRCreateCommand(tls *crt.TLS, interp, cmdName, proc, nreProc, clientData, deleteProc uintptr) uintptr {
// panic(todo(""))
// }
//
// // int Tcl_NREvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int flags);
// func XTcl_NREvalObj(tls *crt.TLS, interp, objPtr uintptr, flags int32) int32 { panic(todo("")) }
//
// // Tcl_Obj * Tcl_NewByteArrayObj(const unsigned char *bytes, int length);
// func XTcl_NewByteArrayObj(tls *crt.TLS, bytes uintptr, length int32) uintptr { panic(todo("")) }
//
// // Tcl_Obj * Tcl_NewDoubleObj(double doubleValue);
// func XTcl_NewDoubleObj(tls *crt.TLS, doubleValue float64) uintptr { panic(todo("")) }
//
// // Tcl_Obj * Tcl_NewIntObj(int intValue);
// func XTcl_NewIntObj(tls *crt.TLS, intValue int32) uintptr { panic(todo("")) }
//
// // Tcl_Obj * Tcl_NewListObj(int objc, Tcl_Obj *const objv[]);
// func XTcl_NewListObj(tls *crt.TLS, objc int32, objv uintptr) uintptr { panic(todo("")) }
//
// // Tcl_Obj * Tcl_NewObj(void);
// func XTcl_NewObj(tls *crt.TLS) uintptr { panic(todo("")) }
//
// // Tcl_Obj * Tcl_NewStringObj(const char *bytes, int length);
// func XTcl_NewStringObj(tls *crt.TLS, bytes uintptr, length int32) uintptr { panic(todo("")) }
//
// // Tcl_Obj * Tcl_NewWideIntObj(Tcl_WideInt wideValue);
// func XTcl_NewWideIntObj(tls *crt.TLS, wideValue crt.Intptr) uintptr { panic(todo("")) }
//
// // Tcl_Obj * Tcl_ObjSetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, Tcl_Obj *newValuePtr, int flags);
// func XTcl_ObjSetVar2(tls *crt.TLS, interp, part1, part2, newValuePtr uintptr, flags int32) uintptr {
// panic(todo(""))
// }
//
// // int Tcl_PkgProvideEx(Tcl_Interp *interp, const char *name, const char *version, const void *clientData);
// func XTcl_PkgProvideEx(tls *crt.TLS, interp, name0, version0, clientData uintptr) int32 {
// name := crt.GoString(name0)
// version := crt.GoString(version0)
// switch name {
// case "sqlite3":
// if version != sqlite3.SQLITE_VERSION {
// panic(todo("%q %q", name, version))
// }
// default:
// panic(todo("%q %q", name, version))
// }
//
// return int32(tee.Ok)
// }
//
// // void Tcl_ResetResult(Tcl_Interp *interp);
// func XTcl_ResetResult(tls *crt.TLS, interp uintptr) { panic(todo("")) }
//
// // void Tcl_SetIntObj(Tcl_Obj *objPtr, int intValue);
// func XTcl_SetIntObj(tls *crt.TLS, objPtr uintptr, intValue int32) { panic(todo("")) }
//
// // void Tcl_SetObjResult(Tcl_Interp *interp, Tcl_Obj *resultObjPtr);
// func XTcl_SetObjResult(tls *crt.TLS, interp, resultObjPtr uintptr) { panic(todo("")) }
//
// // Tcl_SetSystemEncoding sets the default encoding that should be used whenever
// // the user passes a NULL value for the encoding argument to any of the other
// // encoding functions. If name is NULL, the system encoding is reset to the
// // default system encoding, binary. If the name did not refer to any known or
// // loadable encoding, TCL_ERROR is returned and an error message is left in
// // interp. Otherwise, this procedure increments the reference count of the new
// // system encoding, decrements the reference count of the old system encoding,
// // and returns TCL_OK.
// //
// // int Tcl_SetSystemEncoding(Tcl_Interp *interp, const char *name);
// func XTcl_SetSystemEncoding(tls *crt.TLS, interp, name0 uintptr) int32 {
// name := crt.GoString(name0)
// if interp != 0 {
// panic(todo(""))
// }
//
// if name != "utf-8" {
// panic(todo(""))
// }
//
// return int32(tee.Ok)
// }
//
// // Tcl_SetVar2Ex, Tcl_SetVar, Tcl_SetVar2, and Tcl_ObjSetVar2 will create a new
// // variable or modify an existing one. These procedures set the given variable
// // to the value given by newValuePtr or newValue and return a pointer to the
// // variable's new value, which is stored in Tcl's variable structure.
// // Tcl_SetVar2Ex and Tcl_ObjSetVar2 take the new value as a Tcl_Obj and return
// // a pointer to a Tcl_Obj. Tcl_SetVar and Tcl_SetVar2 take the new value as a
// // string and return a string; they are usually less efficient than
// // Tcl_ObjSetVar2. Note that the return value may be different than the
// // newValuePtr or newValue argument, due to modifications made by write traces.
// // If an error occurs in setting the variable (e.g. an array variable is
// // referenced without giving an index into the array) NULL is returned and an
// // error message is left in interp's result if the TCL_LEAVE_ERR_MSG flag bit
// // is set.
// //
// // The name of a variable may be specified to these procedures in four ways:
// //
// // 1. If Tcl_SetVar, Tcl_GetVar, or Tcl_UnsetVar is invoked, the variable name
// // is given as a single string, varName. If varName contains an open
// // parenthesis and ends with a close parenthesis, then the value between the
// // parentheses is treated as an index (which can have any string value) and the
// // characters before the first open parenthesis are treated as the name of an
// // array variable. If varName does not have parentheses as described above,
// // then the entire string is treated as the name of a scalar variable.
// //
// // 2. If the name1 and name2 arguments are provided and name2 is non-NULL, then
// // an array element is specified and the array name and index have already been
// // separated by the caller: name1 contains the name and name2 contains the
// // index. An error is generated if name1 contains an open parenthesis and ends
// // with a close parenthesis (array element) and name2 is non-NULL.
// //
// // 3. If name2 is NULL, name1 is treated just like varName in case [1] above
// // (it can be either a scalar or an array element variable name).
// //
// // The flags argument may be used to specify any of several options to the
// // procedures. It consists of an OR-ed combination of the following bits.
// //
// // TCL_GLOBAL_ONLY
// //
// // Under normal circumstances the procedures look up variables as follows. If a
// // procedure call is active in interp, the variable is looked up at the current
// // level of procedure call. Otherwise, the variable is looked up first in the
// // current namespace, then in the global namespace. However, if this bit is set
// // in flags then the variable is looked up only in the global namespace even if
// // there is a procedure call active. If both TCL_GLOBAL_ONLY and
// // TCL_NAMESPACE_ONLY are given, TCL_GLOBAL_ONLY is ignored.
// //
// // TCL_NAMESPACE_ONLY
// //
// // If this bit is set in flags then the variable is looked up only in the
// // current namespace; if a procedure is active its variables are ignored, and
// // the global namespace is also ignored unless it is the current namespace.
// //
// // TCL_LEAVE_ERR_MSG
// //
// // If an error is returned and this bit is set in flags, then an error message
// // will be left in the interpreter's result, where it can be retrieved with
// // Tcl_GetObjResult or Tcl_GetStringResult. If this flag bit is not set then no
// // error message is left and the interpreter's result will not be modified.
// //
// // TCL_APPEND_VALUE
// // If this bit is set then newValuePtr or newValue is appended to the current
// // value instead of replacing it. If the variable is currently undefined, then
// // the bit is ignored. This bit is only used by the Tcl_Set* procedures.
// //
// // TCL_LIST_ELEMENT
// //
// // If this bit is set, then newValue is converted to a valid Tcl list element
// // before setting (or appending to) the variable. A separator space is appended
// // before the new list element unless the list element is going to be the first
// // element in a list or sublist (i.e. the variable's current value is empty, or
// // contains the single character “{”, or ends in “ }”). When appending, the
// // original value of the variable must also be a valid list, so that the
// // operation is the appending of a new list element onto a list.
// //
// // const char * Tcl_SetVar2(Tcl_Interp *interp, const char *part1, const char *part2, const char *newValue, int flags);
// func XTcl_SetVar2(tls *crt.TLS, interp, part10, part20, newValue0 uintptr, flags int32) {
// ctx := getObject(interp).(*tee.Context)
// part1 := crt.GoString(part10)
// part2 := crt.GoString(part20)
// newValue := crt.GoString(newValue0)
// if part20 != 0 && (strings.Contains(part1, "(") || strings.Contains(part1, ")")) {
// panic(todo(""))
// }
//
// name := part1
// if part2 != "" {
// name = fmt.Sprintf("%s(%s)", part1, part2)
// }
// switch flags {
// case TCL_GLOBAL_ONLY:
// _ = ctx
// panic(todo("%q %q %q %q %#x(%[5]v)", part1, part2, name, newValue, flags))
// default:
// panic(todo("%q %q %q %q %#x(%[5]v)", part1, part2, name, newValue, flags))
// }
// }
//
// // void Tcl_SetWideIntObj(Tcl_Obj *objPtr, Tcl_WideInt wideValue);
// func XTcl_SetWideIntObj(tls *crt.TLS, objPtr uintptr, wideValue crt.Intptr) { panic(todo("")) }
//
// // char * Tcl_TranslateFileName(Tcl_Interp *interp, const char *name, Tcl_DString *bufferPtr);
// func XTcl_TranslateFileName(tls *crt.TLS, interp, name, bufferPtr uintptr) uintptr { panic(todo("")) }
//
// // int Tcl_UnsetVar2(Tcl_Interp *interp, const char *part1, const char *part2, int flags);
// func XTcl_UnsetVar2(tls *crt.TLS, interp, part1, part2 uintptr, flags int32) { panic(todo("")) }
//
// // int Tcl_VarEval(Tcl_Interp *interp, ...);
// func XTcl_VarEval(tls *crt.TLS, interp, va uintptr) int32 { panic(todo("")) }
//
// // void Tcl_WrongNumArgs(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], const char *message);
// func XTcl_WrongNumArgs(tls *crt.TLS, interp uintptr, objc int32, objv, message uintptr) {
// panic(todo(""))
// }
//
// // int Tcl_GetCommandInfo(Tcl_Interp *interp, const char *cmdName, Tcl_CmdInfo *infoPtr);
// func XTcl_GetCommandInfo(tls *crt.TLS, interp, cmdName, infoPtr uintptr) int32 {
// panic(todo(""))
// }
//
// // Tcl_Command Tcl_CreateCommand(Tcl_Interp *interp, const char *cmdName, Tcl_CmdProc *proc, ClientData clientData, Tcl_CmdDeleteProc *deleteProc);
// func XTcl_CreateCommand(tls *crt.TLS, interp, cmdName, proc, clentData, deleteProc uintptr) uintptr {
// panic(todo(""))
// }
//
// // int Tcl_LinkVar(Tcl_Interp *interp, const char *varName, char *addr, int type);
// func XTcl_LinkVar(tls *crt.TLS, interp, varName, addr uintptr, type1 int32) int32 {
// panic(todo(""))
// }
//
// // void Tcl_AppendElement(Tcl_Interp *interp, const char *element);
// func XTcl_AppendElement(tls *crt.TLS, interp, element uintptr) {
// panic(todo(""))
// }
//
// // int Tcl_GetInt(Tcl_Interp *interp, const char *src, int *intPtr);
// func XTcl_GetInt(tls *crt.TLS, interp, src, intPtr uintptr) int32 {
// panic(todo(""))
// }
//
// // int Tcl_GetDouble(Tcl_Interp *interp, const char *src, double *doublePtr);
// func XTcl_GetDouble(tls *crt.TLS, interp, src, doublePtr uintptr) int32 {
// panic(todo(""))
// }
//
// // Tcl_Channel Tcl_GetChannel(Tcl_Interp *interp, const char *chanName, int *modePtr);
// func XTcl_GetChannel(tls *crt.TLS, interp, chanName, modePtr uintptr) uintptr {
// panic(todo(""))
// }
//
// // int Tcl_Flush(Tcl_Channel chan);
// func XTcl_Flush(tls *crt.TLS, chan1 uintptr) int32 {
// panic(todo(""))
// }
//
// // Tcl_WideInt Tcl_Seek(Tcl_Channel chan, Tcl_WideInt offset, int mode);
// func XTcl_Seek(tls *crt.TLS, chan1 uintptr, offset crt.Intptr, mode int32) crt.Intptr {
// panic(todo(""))
// }
//
// // ClientData Tcl_GetChannelInstanceData(Tcl_Channel chan);
// func XTcl_GetChannelInstanceData(tls *crt.TLS, chan1 uintptr) uintptr {
// panic(todo(""))
// }
//
// // int Tcl_EvalEx(Tcl_Interp *interp, const char *script, int numBytes, int flags);
// func XTcl_EvalEx(tls *crt.TLS, interp, script uintptr, numBytes, flags int32) int32 {
// panic(todo(""))
// }
//
// // __attribute__ ((noreturn)) void Tcl_Panic(const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2)));
// func XTcl_Panic(tls *crt.TLS, format, va uintptr) {
// panic(todo(""))
// }
//
// // int Tcl_GetBoolean(Tcl_Interp *interp, const char *src, int *boolPtr);
// func XTcl_GetBoolean(tls *crt.TLS, interp, src, boolPtr uintptr) int32 {
// panic(todo(""))
// }
//
// // char * Tcl_AttemptAlloc(unsigned int size);
// func XTcl_AttemptAlloc(tls *crt.TLS, size uint32) uintptr {
// panic(todo(""))
// }
//
// // char * Tcl_AttemptRealloc(char *ptr, unsigned int size);
// func XTcl_AttemptRealloc(tls *crt.TLS, ptr uintptr, size uint32) uintptr {
// panic(todo(""))
// }
//
// // int Tcl_UtfToLower(char *src);
// func XTcl_UtfToLower(tls *crt.TLS, src uintptr) int32 {
// panic(todo(""))
// }
//
// // void Tcl_AppendStringsToObj(Tcl_Obj *objPtr, ...);
// func XTcl_AppendStringsToObj(tls *crt.TLS, objPtr, va uintptr) {
// panic(todo(""))
// }
//
// // Tcl_HashEntry * Tcl_FirstHashEntry(Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr);
// func XTcl_FirstHashEntry(tls *crt.TLS, tablePtr, searchPtr uintptr) uintptr {
// panic(todo(""))
// }
//
// // Tcl_HashEntry * Tcl_NextHashEntry(Tcl_HashSearch *searchPtr);
// func XTcl_NextHashEntry(tls *crt.TLS, searchPtr uintptr) uintptr {
// panic(todo(""))
// }
//
// // void Tcl_DeleteHashTable(Tcl_HashTable *tablePtr);
// func XTcl_DeleteHashTable(tls *crt.TLS, tablePtr uintptr) {
// panic(todo(""))
// }
//
// // void Tcl_InitHashTable(Tcl_HashTable *tablePtr, int keyType);
// func XTcl_InitHashTable(tls *crt.TLS, tablePtr uintptr, keyType int32) {
// panic(todo(""))
// }
//
// // int Tcl_SetCommandInfo(Tcl_Interp *interp, const char *cmdName, const Tcl_CmdInfo *infoPtr);
// func XTcl_SetCommandInfo(tls *crt.TLS, interp, cmdName, infoPtr uintptr) int32 {
// panic(todo(""))
// }
//
// // void Tcl_AppendObjToObj(Tcl_Obj *objPtr, Tcl_Obj *appendObjPtr);
// func XTcl_AppendObjToObj(tls *crt.TLS, objPtr, appendObjPtr uintptr) {
// panic(todo(""))
// }
//
// // Tcl_Obj * Tcl_ObjGetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *part2Ptr, int flags);
// func XTcl_ObjGetVar2(tls *crt.TLS, interp, part1Ptr, part2Ptr uintptr, flags int32) uintptr {
// panic(todo(""))
// }
//
// // void Tcl_ThreadQueueEvent(Tcl_ThreadId threadId, Tcl_Event *evPtr, Tcl_QueuePosition position);
// func XTcl_ThreadQueueEvent(tls *crt.TLS, threadId, evPtr uintptr, position uint32) {
// panic(todo(""))
// }
//
// // void Tcl_ThreadAlert(Tcl_ThreadId threadId);
// func XTcl_ThreadAlert(tls *crt.TLS, threadId uintptr) {
// panic(todo(""))
// }
//
// // void Tcl_DeleteInterp(Tcl_Interp *interp);
// func XTcl_DeleteInterp(tls *crt.TLS, interp uintptr) {
// panic(todo(""))
// }
//
// // int Tcl_DoOneEvent(int flags);
// func XTcl_DoOneEvent(tls *crt.TLS, flags int32) int32 {
// panic(todo(""))
// }
//
// // void Tcl_ExitThread(int status);
// func XTcl_ExitThread(tls *crt.TLS, status int32) {
// panic(todo(""))
// }
//
// // Tcl_ThreadId Tcl_GetCurrentThread(void);
// func XTcl_GetCurrentThread(tls *crt.TLS) uintptr {
// panic(todo(""))
// }
//
// // int Tcl_CreateThread(Tcl_ThreadId *idPtr, Tcl_ThreadCreateProc *proc, ClientData clientData, int stackSize, int flags);
// func XTcl_CreateThread(tls *crt.TLS, idPtr, proc, clientData uintptr, stackSize, flags int32) int32 {
// panic(todo(""))
// }
//
// // void Tcl_GetTime(Tcl_Time *timeBuf);
// func XTcl_GetTime(tls *crt.TLS, timeBuf uintptr) {
// panic(todo(""))
// }
//
// // Tcl_Interp * Tcl_GetSlave(Tcl_Interp *interp, const char *slaveName);
// func XTcl_GetSlave(tls *crt.TLS, interp, slaveName uintptr) uintptr {
// panic(todo(""))
// }
//
// // ============================================================================

View File

@@ -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 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_DQS=0 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_UTF16 -DSQLITE_TEST -DSQLITE_THREADSAFE=2 -ccgo-long-double-is-double', DO NOT EDIT.
// 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.
package main
@@ -3685,9 +3685,7 @@ func evalSql(tls *crt.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* mp
ap = va
zSql = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
_ = ap
if !(g.iTimeout > 0) {
crt.X__assert_fail(tls, ts+151 /* "g.iTimeout>0" */, ts+164 /* "testdata/sqlite-..." */, uint32(494), uintptr(unsafe.Pointer(&__func__)))
}
rc = sqlite3.Xsqlite3_exec(tls, g.db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
f func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32
}{evalCallback})), p, bp+8 /* &zErrMsg */)
@@ -3695,7 +3693,7 @@ func evalSql(tls *crt.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* mp
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+208 /* "error(%d)" */, crt.VaList(bp, rc))
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+16 /* &zErr[0] */, ts+151 /* "error(%d)" */, crt.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 */)))
@@ -3705,8 +3703,6 @@ func evalSql(tls *crt.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* mp
return rc
}
var __func__ = *(*[8]int8)(unsafe.Pointer(ts + 218 /* "evalSql" */)) /* mptest.c:486:56 */
// Auxiliary SQL function to recursively evaluate SQL.
func evalFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* mptest.c:512:13: */
bp := tls.Alloc(24)
@@ -3749,57 +3745,57 @@ func startScript(tls *crt.TLS, iClient int32, pzScript uintptr, pTaskId uintptr,
*(*uintptr)(unsafe.Pointer(pzScript)) = uintptr(0)
g.iTimeout = 0
for 1 != 0 {
rc = trySql(tls, ts+226 /* "BEGIN IMMEDIATE" */, 0)
rc = trySql(tls, ts+161 /* "BEGIN IMMEDIATE" */, 0)
if rc == 5 {
sqlite3.Xsqlite3_sleep(tls, 10)
totalTime = totalTime + (10)
continue
}
if rc != 0 {
fatalError(tls, ts+242 /* "in startScript: ..." */, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
fatalError(tls, ts+177 /* "in startScript: ..." */, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
}
if (g.nError != 0) || (g.nTest != 0) {
runSql(tls, ts+261, /* "UPDATE counters ..." */
runSql(tls, ts+196, /* "UPDATE counters ..." */
crt.VaList(bp+8, g.nError, g.nTest))
g.nError = 0
g.nTest = 0
}
pStmt = prepareSql(tls, ts+314 /* "SELECT 1 FROM cl..." */, crt.VaList(bp+24, iClient))
pStmt = prepareSql(tls, ts+249 /* "SELECT 1 FROM cl..." */, crt.VaList(bp+24, iClient))
rc = sqlite3.Xsqlite3_step(tls, pStmt)
sqlite3.Xsqlite3_finalize(tls, pStmt)
if rc == 100 {
runSql(tls, ts+360 /* "DELETE FROM clie..." */, crt.VaList(bp+32, iClient))
runSql(tls, ts+295 /* "DELETE FROM clie..." */, crt.VaList(bp+32, iClient))
g.iTimeout = 10000
runSql(tls, ts+391 /* "COMMIT TRANSACTI..." */, 0)
runSql(tls, ts+326 /* "COMMIT TRANSACTI..." */, 0)
return 101
}
pStmt = prepareSql(tls,
ts+411 /* "SELECT script, i..." */, crt.VaList(bp+40, iClient))
ts+346 /* "SELECT script, i..." */, crt.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+503 /* "%s" */, crt.VaList(bp+48, sqlite3.Xsqlite3_column_text(tls, pStmt, 2)))
*(*uintptr)(unsafe.Pointer(pzTaskName)) = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, crt.VaList(bp+48, sqlite3.Xsqlite3_column_text(tls, pStmt, 2)))
sqlite3.Xsqlite3_finalize(tls, pStmt)
runSql(tls,
ts+506 /* "UPDATE task SE..." */, crt.VaList(bp+56, taskId))
ts+441 /* "UPDATE task SE..." */, crt.VaList(bp+56, taskId))
g.iTimeout = 10000
runSql(tls, ts+391 /* "COMMIT TRANSACTI..." */, 0)
runSql(tls, ts+326 /* "COMMIT TRANSACTI..." */, 0)
return 0
}
sqlite3.Xsqlite3_finalize(tls, pStmt)
if rc == 101 {
if totalTime > 30000 {
errorMessage(tls, ts+589 /* "Waited over 30 s..." */, 0)
runSql(tls, ts+638 /* "DELETE FROM clie..." */, crt.VaList(bp+64, iClient))
errorMessage(tls, ts+524 /* "Waited over 30 s..." */, 0)
runSql(tls, ts+573 /* "DELETE FROM clie..." */, crt.VaList(bp+64, iClient))
sqlite3.Xsqlite3_close(tls, g.db)
crt.Xexit(tls, 1)
}
for trySql(tls, ts+678 /* "COMMIT" */, 0) == 5 {
for trySql(tls, ts+613 /* "COMMIT" */, 0) == 5 {
sqlite3.Xsqlite3_sleep(tls, 10)
totalTime = totalTime + (10)
}
@@ -3807,7 +3803,7 @@ func startScript(tls *crt.TLS, iClient int32, pzScript uintptr, pTaskId uintptr,
totalTime = totalTime + (100)
continue
}
fatalError(tls, ts+503 /* "%s" */, crt.VaList(bp+72, sqlite3.Xsqlite3_errmsg(tls, g.db)))
fatalError(tls, ts+438 /* "%s" */, crt.VaList(bp+72, sqlite3.Xsqlite3_errmsg(tls, g.db)))
}
g.iTimeout = 10000
return int32(0)
@@ -3821,9 +3817,9 @@ func finishScript(tls *crt.TLS, iClient int32, taskId int32, bShutdown int32) in
runSql(tls,
ts+685 /* "UPDATE task SE..." */, crt.VaList(bp, taskId))
ts+620 /* "UPDATE task SE..." */, crt.VaList(bp, taskId))
if bShutdown != 0 {
runSql(tls, ts+360 /* "DELETE FROM clie..." */, crt.VaList(bp+8, iClient))
runSql(tls, ts+295 /* "DELETE FROM clie..." */, crt.VaList(bp+8, iClient))
}
return 0
}
@@ -3835,28 +3831,28 @@ func startClient(tls *crt.TLS, iClient int32) { /* mptest.c:638:13: */
bp := tls.Alloc(96)
defer tls.Free(96)
runSql(tls, ts+766 /* "INSERT OR IGNORE..." */, crt.VaList(bp, iClient))
runSql(tls, ts+701 /* "INSERT OR IGNORE..." */, crt.VaList(bp, iClient))
if sqlite3.Xsqlite3_changes(tls, g.db) != 0 {
var zSys uintptr
var rc int32
zSys = sqlite3.Xsqlite3_mprintf(tls, ts+808, /* "%s \"%s\" --client..." */
zSys = sqlite3.Xsqlite3_mprintf(tls, ts+743, /* "%s \"%s\" --client..." */
crt.VaList(bp+8, g.argv0, g.zDbFile, iClient, g.iTrace))
if g.bSqlTrace != 0 {
zSys = sqlite3.Xsqlite3_mprintf(tls, ts+839 /* "%z --sqltrace" */, crt.VaList(bp+40, zSys))
zSys = sqlite3.Xsqlite3_mprintf(tls, ts+774 /* "%z --sqltrace" */, crt.VaList(bp+40, zSys))
}
if g.bSync != 0 {
zSys = sqlite3.Xsqlite3_mprintf(tls, ts+853 /* "%z --sync" */, crt.VaList(bp+48, zSys))
zSys = sqlite3.Xsqlite3_mprintf(tls, ts+788 /* "%z --sync" */, crt.VaList(bp+48, zSys))
}
if g.zVfs != 0 {
zSys = sqlite3.Xsqlite3_mprintf(tls, ts+863 /* "%z --vfs \"%s\"" */, crt.VaList(bp+56, zSys, g.zVfs))
zSys = sqlite3.Xsqlite3_mprintf(tls, ts+798 /* "%z --vfs \"%s\"" */, crt.VaList(bp+56, zSys, g.zVfs))
}
if g.iTrace >= 2 {
logMessage(tls, ts+877 /* "system('%q')" */, crt.VaList(bp+72, zSys))
logMessage(tls, ts+812 /* "system('%q')" */, crt.VaList(bp+72, zSys))
}
zSys = sqlite3.Xsqlite3_mprintf(tls, ts+890 /* "%z &" */, crt.VaList(bp+80, zSys))
zSys = sqlite3.Xsqlite3_mprintf(tls, ts+825 /* "%z &" */, crt.VaList(bp+80, zSys))
rc = crt.Xsystem(tls, zSys)
if rc != 0 {
errorMessage(tls, ts+895 /* "system() fails w..." */, crt.VaList(bp+88, rc))
errorMessage(tls, ts+830 /* "system() fails w..." */, crt.VaList(bp+88, rc))
}
sqlite3.Xsqlite3_free(tls, zSys)
}
@@ -3867,11 +3863,11 @@ func readFile(tls *crt.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
var in uintptr = crt.Xfopen(tls, zFilename, ts+929 /* "rb" */)
var in uintptr = crt.Xfopen(tls, zFilename, ts+864 /* "rb" */)
var sz int64
var z uintptr
if in == uintptr(0) {
fatalError(tls, ts+932 /* "cannot open \"%s\"..." */, crt.VaList(bp, zFilename))
fatalError(tls, ts+867 /* "cannot open \"%s\"..." */, crt.VaList(bp, zFilename))
}
crt.Xfseek(tls, in, int64(0), 2)
sz = crt.Xftell(tls, in)
@@ -3956,7 +3952,7 @@ 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: */
var n int32 = 0
for (*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && ((crt.Xstrncmp(tls, (z+uintptr(n)), ts+961 /* "--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(uint16(8192))) != 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(uint16(8192))) != 0)) {
n = n + (tokenLength(tls, (z + uintptr(n)), pnLine))
}
return n
@@ -3969,11 +3965,11 @@ func findEndif(tls *crt.TLS, z uintptr, stopAtElse int32, pnLine uintptr) int32
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+967 /* "--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(uint16(8192))) != 0)) ||
(((stopAtElse != 0) && (crt.Xstrncmp(tls, (z+uintptr(n)), ts+975 /* "--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(uint16(8192))) != 0)) {
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(uint16(8192))) != 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(uint16(8192))) != 0)) {
return (n + len)
}
if (crt.Xstrncmp(tls, (z+uintptr(n)), ts+982 /* "--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(uint16(8192))) != 0) {
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(uint16(8192))) != 0) {
var skip int32 = findEndif(tls, ((z + uintptr(n)) + uintptr(len)), 0, pnLine)
n = n + (skip + len)
} else {
@@ -3993,12 +3989,12 @@ func waitForClient(tls *crt.TLS, iClient int32, iTimeout int32, zErrPrefix uintp
if iClient > 0 {
pStmt = prepareSql(tls,
ts+987, /* "SELECT 1 FROM ta..." */
ts+922, /* "SELECT 1 FROM ta..." */
crt.VaList(bp, iClient))
} else {
pStmt = prepareSql(tls,
ts+1083 /* "SELECT 1 FROM ta..." */, 0)
ts+1018 /* "SELECT 1 FROM ta..." */, 0)
}
g.iTimeout = 0
for (((crt.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == 5) || (rc == 100)) &&
@@ -4011,12 +4007,12 @@ func waitForClient(tls *crt.TLS, iClient int32, iTimeout int32, zErrPrefix uintp
g.iTimeout = 10000
if rc != 101 {
if zErrPrefix == uintptr(0) {
zErrPrefix = ts + 1164 /* "" */
zErrPrefix = ts + 1099 /* "" */
}
if iClient > 0 {
errorMessage(tls, ts+1165 /* "%stimeout waitin..." */, crt.VaList(bp+8, zErrPrefix, iClient))
errorMessage(tls, ts+1100 /* "%stimeout waitin..." */, crt.VaList(bp+8, zErrPrefix, iClient))
} else {
errorMessage(tls, ts+1197 /* "%stimeout waitin..." */, crt.VaList(bp+24, zErrPrefix))
errorMessage(tls, ts+1132 /* "%stimeout waitin..." */, crt.VaList(bp+24, zErrPrefix))
}
}
}
@@ -4047,13 +4043,13 @@ func booleanValue(tls *crt.TLS, zArg uintptr) int32 { /* mptest.c:845:12: */
if (i > 0) && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) == 0) {
return crt.Xatoi(tls, zArg)
}
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1231 /* "on" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1234 /* "yes" */) == 0) {
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1166 /* "on" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1169 /* "yes" */) == 0) {
return 1
}
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1238 /* "off" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1242 /* "no" */) == 0) {
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1173 /* "off" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1177 /* "no" */) == 0) {
return 0
}
errorMessage(tls, ts+1245 /* "unknown boolean:..." */, crt.VaList(bp, zArg))
errorMessage(tls, ts+1180 /* "unknown boolean:..." */, crt.VaList(bp, zArg))
return 0
}
@@ -4103,7 +4099,7 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
// Run any prior SQL before processing the new --command
if ii > iBegin {
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1267 /* "%.*s" */, crt.VaList(bp, (ii-iBegin), (zScript+uintptr(iBegin))))
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, crt.VaList(bp, (ii-iBegin), (zScript+uintptr(iBegin))))
evalSql(tls, bp+360 /* &sResult */, zSql, 0)
sqlite3.Xsqlite3_free(tls, zSql)
iBegin = (ii + len)
@@ -4111,7 +4107,7 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
// Parse the --command
if g.iTrace >= 2 {
logMessage(tls, ts+1267 /* "%.*s" */, crt.VaList(bp+16, len, (zScript+uintptr(ii))))
logMessage(tls, ts+1202 /* "%.*s" */, crt.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++ {
@@ -4131,7 +4127,7 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
// --sleep N
//
// Pause for N milliseconds
if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1272 /* "sleep" */) == 0 {
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)))
} else
@@ -4139,7 +4135,7 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
//
// 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+1278 /* "exit" */) == 0 {
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))
finishScript(tls, iClient, taskId, 1)
if rc == 0 {
@@ -4152,9 +4148,9 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
//
// Begin a new test case. Announce in the log that the test case
// has begun.
if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1283 /* "testcase" */) == 0 {
if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1218 /* "testcase" */) == 0 {
if g.iTrace == 1 {
logMessage(tls, ts+1267 /* "%.*s" */, crt.VaList(bp+32, (len-1), (zScript+uintptr(ii))))
logMessage(tls, ts+1202 /* "%.*s" */, crt.VaList(bp+32, (len-1), (zScript+uintptr(ii))))
}
stringReset(tls, bp+360 /* &sResult */)
} else
@@ -4163,28 +4159,28 @@ 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+1292 /* "finish" */) == 0) && (iClient > 0) {
if (crt.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+1299 /* "reset" */) == 0 {
if crt.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+1305 /* "match" */) == 0 {
if crt.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(uint16(8192))) != 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) {
errorMessage(tls, ts+1311, /* "line %d of %s:\nE..." */
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))
}
g.nTest++
@@ -4196,7 +4192,7 @@ 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+1356 /* "glob" */) == 0) || (crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1361 /* "notglob" */) == 0) {
if (crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1291 /* "glob" */) == 0) || (crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1296 /* "notglob" */) == 0) {
var jj int32
var zAns uintptr = (zScript + uintptr(ii))
var zCopy uintptr
@@ -4204,9 +4200,9 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
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(uint16(8192))) != 0); jj++ {
}
zAns += uintptr(jj)
zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1267 /* "%.*s" */, crt.VaList(bp+88, ((len-jj)-1), zAns))
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 {
errorMessage(tls, ts+1369, /* "line %d of %s:\nE..." */
errorMessage(tls, ts+1304, /* "line %d of %s:\nE..." */
crt.VaList(bp+104, prevLine, zFilename, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
}
sqlite3.Xsqlite3_free(tls, zCopy)
@@ -4217,14 +4213,14 @@ 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+1412 /* "output" */) == 0 {
logMessage(tls, ts+503 /* "%s" */, crt.VaList(bp+136, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
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))
} else
// --source FILENAME
//
// Run a subscript from a separate file.
if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1419 /* "source" */) == 0 {
if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1354 /* "source" */) == 0 {
var zNewFile uintptr
var zNewScript uintptr
var zToDel uintptr = uintptr(0)
@@ -4234,17 +4230,17 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
for k = (int32(crt.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+1426 /* "%.*s/%s" */, crt.VaList(bp+144, k, zFilename, zNewFile)))
zNewFile = crt.AssignUintptr(&zToDel, sqlite3.Xsqlite3_mprintf(tls, ts+1361 /* "%.*s/%s" */, crt.VaList(bp+144, k, zFilename, zNewFile)))
}
}
zNewScript = readFile(tls, zNewFile)
if g.iTrace != 0 {
logMessage(tls, ts+1434 /* "begin script [%s..." */, crt.VaList(bp+168, zNewFile))
logMessage(tls, ts+1369 /* "begin script [%s..." */, crt.VaList(bp+168, zNewFile))
}
runScript(tls, 0, 0, zNewScript, zNewFile)
sqlite3.Xsqlite3_free(tls, zNewScript)
if g.iTrace != 0 {
logMessage(tls, ts+1453 /* "end script [%s]\n" */, crt.VaList(bp+176, zNewFile))
logMessage(tls, ts+1388 /* "end script [%s]\n" */, crt.VaList(bp+176, zNewFile))
}
sqlite3.Xsqlite3_free(tls, zToDel)
} else
@@ -4252,23 +4248,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+1470 /* "print" */) == 0 {
if crt.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(uint16(8192))) != 0); jj++ {
}
logMessage(tls, ts+1267 /* "%.*s" */, crt.VaList(bp+184, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
logMessage(tls, ts+1202 /* "%.*s" */, crt.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+1476 /* "if" */) == 0 {
if crt.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(uint16(8192))) != 0); jj++ {
}
pStmt = prepareSql(tls, ts+1479 /* "SELECT %.*s" */, crt.VaList(bp+200, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, crt.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 */))
@@ -4280,7 +4276,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+1491 /* "else" */) == 0 {
if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1426 /* "else" */) == 0 {
ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 0, bp+376 /* &lineno */))
} else
@@ -4288,13 +4284,13 @@ 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+1496 /* "endif" */) == 0 {
if crt.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+1502 /* "start" */) == 0) && (iClient == 0) {
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 iNewClient > 0 {
startClient(tls, iNewClient)
@@ -4306,14 +4302,14 @@ 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+1508 /* "wait" */) == 0) && (iClient == 0) {
if (crt.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))
} else {
iTimeout = 10000
}
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([1000]int8{})), bp+610 /* &zError[0] */, ts+1513, /* "line %d of %s\n" */
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] */)
} else
@@ -4324,25 +4320,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+1528 /* "task" */) == 0) && (iClient == 0) {
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))
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+1533, /* "line %d of %s: b..." */
errorMessage(tls, ts+1468, /* "line %d of %s: b..." */
crt.VaList(bp+232, prevLine, zFilename, iTarget))
} else {
zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1267 /* "%.*s" */, crt.VaList(bp+256, iEnd, ((zScript+uintptr(ii))+uintptr(len))))
zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, crt.VaList(bp+256, iEnd, ((zScript+uintptr(ii))+uintptr(len))))
if nArg > 1 {
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+503 /* "%s" */, crt.VaList(bp+272, (bp+410 /* &azArg[0] */ +uintptr(1)*100)))
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, crt.VaList(bp+272, (bp+410 /* &azArg[0] */ +uintptr(1)*100)))
} else {
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+1570 /* "%s:%d" */, crt.VaList(bp+280, filenameTail(tls, zFilename), prevLine))
zTName = sqlite3.Xsqlite3_mprintf(tls, ts+1505 /* "%s:%d" */, crt.VaList(bp+280, filenameTail(tls, zFilename), prevLine))
}
startClient(tls, iTarget)
runSql(tls,
ts+1576 /* "INSERT INTO task..." */, crt.VaList(bp+296, iTarget, zTask, zTName))
ts+1511 /* "INSERT INTO task..." */, crt.VaList(bp+296, iTarget, zTask, zTName))
sqlite3.Xsqlite3_free(tls, zTask)
sqlite3.Xsqlite3_free(tls, zTName)
}
@@ -4355,14 +4351,14 @@ 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+1632 /* "breakpoint" */) == 0 {
if crt.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+1643 /* "show-sql-errors" */) == 0 {
if crt.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))
@@ -4370,13 +4366,13 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
return 1
}()
} else {
errorMessage(tls, ts+1659, /* "line %d of %s: u..." */
errorMessage(tls, ts+1594, /* "line %d of %s: u..." */
crt.VaList(bp+320, prevLine, zFilename, bp+380 /* &zCmd[0] */))
}
ii = ii + (len)
}
if iBegin < ii {
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1267 /* "%.*s" */, crt.VaList(bp+344, (ii-iBegin), (zScript+uintptr(iBegin))))
var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, crt.VaList(bp+344, (ii-iBegin), (zScript+uintptr(iBegin))))
runSql(tls, zSql, 0)
sqlite3.Xsqlite3_free(tls, zSql)
}
@@ -4398,9 +4394,6 @@ func findOption(tls *crt.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, has
var zReturn uintptr = uintptr(0)
var nArg int32 = *(*int32)(unsafe.Pointer(pnArg))
if !((hasArg == 0) || (hasArg == 1)) {
crt.X__assert_fail(tls, ts+1695 /* "hasArg==0 || has..." */, ts+164 /* "testdata/sqlite-..." */, uint32(1211), uintptr(unsafe.Pointer(&__func__1)))
}
for i = 0; i < nArg; i++ {
var z uintptr
if (i + hasArg) >= nArg {
@@ -4419,7 +4412,7 @@ func findOption(tls *crt.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, has
}
if crt.Xstrcmp(tls, z, zOption) == 0 {
if (hasArg != 0) && (i == (nArg - 1)) {
fatalError(tls, ts+1718 /* "command-line opt..." */, crt.VaList(bp, z))
fatalError(tls, ts+1630 /* "command-line opt..." */, crt.VaList(bp, z))
}
if hasArg != 0 {
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8))
@@ -4437,8 +4430,6 @@ func findOption(tls *crt.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, has
return zReturn
}
var __func__1 = *(*[11]int8)(unsafe.Pointer(ts + 1766 /* "findOption" */)) /* mptest.c:1206:2 */
// Print a usage message for the program and exit
func usage(tls *crt.TLS, argv0 uintptr) { /* mptest.c:1241:13: */
bp := tls.Alloc(8)
@@ -4451,10 +4442,10 @@ func usage(tls *crt.TLS, argv0 uintptr) { /* mptest.c:1241:13: */
zTail = ((argv0 + uintptr(i)) + uintptr(1))
}
}
crt.Xfprintf(tls, crt.Xstderr, ts+1777 /* "Usage: %s DATABA..." */, crt.VaList(bp, zTail))
crt.Xfprintf(tls, crt.Xstderr, ts+1678 /* "Usage: %s DATABA..." */, crt.VaList(bp, zTail))
crt.Xfprintf(tls, crt.Xstderr,
ts+1816 /* "Options:\n --er..." */, 0)
ts+1717 /* "Options:\n --er..." */, 0)
crt.Xexit(tls, 1)
}
@@ -4464,11 +4455,11 @@ func unrecognizedArguments(tls *crt.TLS, argv0 uintptr, nArg int32, azArg uintpt
defer tls.Free(16)
var i int32
crt.Xfprintf(tls, crt.Xstderr, ts+2388 /* "%s: unrecognized..." */, crt.VaList(bp, argv0))
crt.Xfprintf(tls, crt.Xstderr, ts+2289 /* "%s: unrecognized..." */, crt.VaList(bp, argv0))
for i = 0; i < nArg; i++ {
crt.Xfprintf(tls, crt.Xstderr, ts+2416 /* " %s" */, crt.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))))
crt.Xfprintf(tls, crt.Xstderr, ts+2317 /* " %s" */, crt.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))))
}
crt.Xfprintf(tls, crt.Xstderr, ts+2420 /* "\n" */, 0)
crt.Xfprintf(tls, crt.Xstderr, ts+2321 /* "\n" */, 0)
crt.Xexit(tls, 1)
}
@@ -4502,50 +4493,50 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
usage(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
}
g.zDbFile = *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))
if strglob(tls, ts+2422 /* "*.test" */, g.zDbFile) != 0 {
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+2429 /* "2020-06-18 14:00..." */) != 0 {
if crt.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2020-06-18 14:00..." */) != 0 {
crt.Xfprintf(tls, crt.Xstderr,
ts+2514, /* "SQLite library a..." */
crt.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2429 /* "2020-06-18 14:00..." */))
ts+2415, /* "SQLite library a..." */
crt.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2020-06-18 14:00..." */))
crt.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+2574 /* "%05d.mptest" */, crt.VaList(bp+16, crt.Xgetpid(tls)))
zJMode = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2586 /* "journalmode" */, 1)
zNRep = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2598 /* "repeat" */, 1)
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)))
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)
}
if nRep < 1 {
nRep = 1
}
g.zVfs = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2605 /* "vfs" */, 1)
zClient = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2609 /* "client" */, 1)
g.zErrLog = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2616 /* "errlog" */, 1)
g.zLog = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2623 /* "log" */, 1)
zTrace = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2627 /* "trace" */, 1)
g.zVfs = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2506 /* "vfs" */, 1)
zClient = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2510 /* "client" */, 1)
g.zErrLog = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2517 /* "errlog" */, 1)
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)
}
if findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2633 /* "quiet" */, 0) != uintptr(0) {
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+2639 /* "timeout" */, 1)
zTmout = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2540 /* "timeout" */, 1)
if zTmout != 0 {
iTmout = crt.Xatoi(tls, zTmout)
}
g.bSqlTrace = (crt.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2647 /* "sqltrace" */, 0) != uintptr(0)))
g.bSync = (crt.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2656 /* "sync" */, 0) != uintptr(0)))
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)))
if g.zErrLog != 0 {
g.pErrLog = crt.Xfopen(tls, g.zErrLog, ts+2661 /* "a" */)
g.pErrLog = crt.Xfopen(tls, g.zErrLog, ts+2562 /* "a" */)
} else {
g.pErrLog = crt.Xstderr
}
if g.zLog != 0 {
g.pLog = crt.Xfopen(tls, g.zLog, ts+2661 /* "a" */)
g.pLog = crt.Xfopen(tls, g.zLog, ts+2562 /* "a" */)
} else {
g.pLog = crt.Xstdout
}
@@ -4556,33 +4547,33 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
if zClient != 0 {
iClient = crt.Xatoi(tls, zClient)
if iClient < 1 {
fatalError(tls, ts+2663 /* "illegal client n..." */, crt.VaList(bp+40, iClient))
fatalError(tls, ts+2564 /* "illegal client n..." */, crt.VaList(bp+40, iClient))
}
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+64 /* &.zName */, ts+2690, /* "%05d.client%02d" */
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))
} else {
var nTry int32 = 0
if g.iTrace > 0 {
crt.Xprintf(tls, ts+2706 /* "BEGIN: %s" */, crt.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
crt.Xprintf(tls, ts+2607 /* "BEGIN: %s" */, crt.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
for i = 1; i < argc; i++ {
crt.Xprintf(tls, ts+2416 /* " %s" */, crt.VaList(bp+72, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
crt.Xprintf(tls, ts+2317 /* " %s" */, crt.VaList(bp+72, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
crt.Xprintf(tls, ts+2420 /* "\n" */, 0)
crt.Xprintf(tls, ts+2716 /* "With SQLite 3.32..." */, 0)
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+2821 /* "-DSQLITE_%s\n" */, crt.VaList(bp+80, zCOption))
crt.Xprintf(tls, ts+2722 /* "-DSQLITE_%s\n" */, crt.VaList(bp+80, zCOption))
}
crt.Xfflush(tls, crt.Xstdout)
}
iClient = 0
for ok := true; ok; ok = (((rc != 0) && ((crt.PreIncInt32(&nTry, 1)) < 60)) && (sqlite3.Xsqlite3_sleep(tls, 1000) > 0)) {
if (nTry % 5) == 4 {
crt.Xprintf(tls, ts+2834, /* "... %strying to ..." */
crt.Xprintf(tls, ts+2735, /* "... %strying to ..." */
crt.VaList(bp+88, func() uintptr {
if nTry > 5 {
return ts + 2863 /* "still " */
return ts + 2764 /* "still " */
}
return ts + 1164 /* "" */
return ts + 1099 /* "" */
}(), g.zDbFile))
}
rc = crt.Xunlink(tls, g.zDbFile)
@@ -4591,34 +4582,34 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
}
}
if rc != 0 {
fatalError(tls, ts+2870, /* "unable to unlink..." */
fatalError(tls, ts+2771, /* "unable to unlink..." */
crt.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+2911 /* "cannot open [%s]" */, crt.VaList(bp+120, g.zDbFile))
fatalError(tls, ts+2812 /* "cannot open [%s]" */, crt.VaList(bp+120, g.zDbFile))
}
if iTmout > 0 {
sqlite3.Xsqlite3_busy_timeout(tls, g.db, iTmout)
}
if zJMode != 0 {
runSql(tls, ts+2928 /* "PRAGMA journal_m..." */, crt.VaList(bp+128, zJMode))
runSql(tls, ts+2829 /* "PRAGMA journal_m..." */, crt.VaList(bp+128, zJMode))
}
if !(g.bSync != 0) {
trySql(tls, ts+2952 /* "PRAGMA synchrono..." */, 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
}{busyHandler})), uintptr(0))
sqlite3.Xsqlite3_create_function(tls, g.db, ts+2975 /* "vfsname" */, 0, 1, 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)
}{vfsNameFunc})), uintptr(0), uintptr(0))
sqlite3.Xsqlite3_create_function(tls, g.db, ts+2983 /* "eval" */, 1, 1, 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)
}{evalFunc})), uintptr(0), uintptr(0))
@@ -4633,7 +4624,7 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), (argv + uintptr(2)*8))
}
if g.iTrace != 0 {
logMessage(tls, ts+2988 /* "start-client" */, 0)
logMessage(tls, ts+2889 /* "start-client" */, 0)
}
for 1 != 0 {
*(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)) = uintptr(0)
@@ -4642,54 +4633,54 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
break
}
if g.iTrace != 0 {
logMessage(tls, ts+3001 /* "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)" */, crt.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+3015 /* "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)" */, crt.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 */)))
sqlite3.Xsqlite3_sleep(tls, 10)
}
if g.iTrace != 0 {
logMessage(tls, ts+3027 /* "end-client" */, 0)
logMessage(tls, ts+2928 /* "end-client" */, 0)
}
} else {
var pStmt uintptr
var iTimeout int32
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) == 0 {
fatalError(tls, ts+3038 /* "missing script f..." */, 0)
fatalError(tls, ts+2939 /* "missing script f..." */, 0)
}
if *(*int32)(unsafe.Pointer(bp + 232 /* n */)) > 1 {
unrecognizedArguments(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), *(*int32)(unsafe.Pointer(bp + 232 /* n */)), (argv + uintptr(2)*8))
}
runSql(tls,
ts+3062 /* "DROP TABLE IF EX..." */, 0)
ts+2963 /* "DROP TABLE IF EX..." */, 0)
*(*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+3498 /* "begin script [%s..." */, crt.VaList(bp+168, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), iRep))
logMessage(tls, ts+3399 /* "begin script [%s..." */, crt.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+3526 /* "end script [%s] ..." */, crt.VaList(bp+184, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), iRep))
logMessage(tls, ts+3427 /* "end script [%s] ..." */, crt.VaList(bp+184, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), iRep))
}
}
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 240 /* zScript */)))
waitForClient(tls, 0, 2000, ts+3552 /* "during shutdown...." */)
trySql(tls, ts+3572 /* "UPDATE client SE..." */, 0)
waitForClient(tls, 0, 2000, ts+3453 /* "during shutdown...." */)
trySql(tls, ts+3473 /* "UPDATE client SE..." */, 0)
sqlite3.Xsqlite3_sleep(tls, 10)
g.iTimeout = 0
iTimeout = 1000
for (((crt.AssignInt32(&rc, trySql(tls, ts+3601 /* "SELECT 1 FROM cl..." */, 0))) == 5) ||
for (((crt.AssignInt32(&rc, trySql(tls, ts+3502 /* "SELECT 1 FROM cl..." */, 0))) == 5) ||
(rc == 100)) && (iTimeout > 0) {
sqlite3.Xsqlite3_sleep(tls, 10)
iTimeout = iTimeout - (10)
}
sqlite3.Xsqlite3_sleep(tls, 100)
pStmt = prepareSql(tls, ts+3622 /* "SELECT nError, n..." */, 0)
pStmt = prepareSql(tls, ts+3523 /* "SELECT nError, n..." */, 0)
iTimeout = 1000
for ((crt.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == 5) && (iTimeout > 0) {
sqlite3.Xsqlite3_sleep(tls, 10)
@@ -4705,15 +4696,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+3657 /* "Summary: %d erro..." */, crt.VaList(bp+200, g.nError, g.nTest))
crt.Xprintf(tls, ts+3693 /* "END: %s" */, crt.VaList(bp+216, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
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))))
for i = 1; i < argc; i++ {
crt.Xprintf(tls, ts+2416 /* " %s" */, crt.VaList(bp+224, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
crt.Xprintf(tls, ts+2317 /* " %s" */, crt.VaList(bp+224, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
crt.Xprintf(tls, ts+2420 /* "\n" */, 0)
crt.Xprintf(tls, ts+2321 /* "\n" */, 0)
}
return (crt.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'\x00g.iTimeout>0\x00testdata/sqlite-src-3320300/mptest/mptest.c\x00error(%d)\x00evalSql\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\x00hasArg==0 || hasArg==1\x00command-line option \"--%s\" requires an argument\x00findOption\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-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 ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
// Code generated by 'ccgo -DSQLITE_PRIVATE= -ccgo-export-defines -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 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_DQS=0 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_UTF16 -DSQLITE_TEST -DSQLITE_THREADSAFE=2 -ccgo-long-double-is-double', DO NOT EDIT.
// Code generated by 'ccgo -DSQLITE_PRIVATE= -ccgo-export-defines -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.
package sqlite3
@@ -397,6 +397,7 @@ var CAPI = map[string]struct{}{
"sqlite3MemCompare": {},
"sqlite3MemJournalOpen": {},
"sqlite3MemSetDefault": {},
"sqlite3MemdbInit": {},
"sqlite3MisuseError": {},
"sqlite3MulInt64": {},
"sqlite3MultiWrite": {},
@@ -640,6 +641,7 @@ var CAPI = map[string]struct{}{
"sqlite3StatusUp": {},
"sqlite3StatusValue": {},
"sqlite3StmtCurrentTime": {},
"sqlite3StmtVtabInit": {},
"sqlite3StorageColumnToTable": {},
"sqlite3StrAccumFinish": {},
"sqlite3StrAccumInit": {},
@@ -679,8 +681,11 @@ var CAPI = map[string]struct{}{
"sqlite3UpsertDoUpdate": {},
"sqlite3UpsertDup": {},
"sqlite3UpsertNew": {},
"sqlite3Utf16ByteLen": {},
"sqlite3Utf16to8": {},
"sqlite3Utf8CharLen": {},
"sqlite3Utf8Read": {},
"sqlite3UtfSelfTest": {},
"sqlite3VListAdd": {},
"sqlite3VListNameToNum": {},
"sqlite3VListNumToName": {},
@@ -708,6 +713,7 @@ var CAPI = map[string]struct{}{
"sqlite3VdbeAllocUnpackedRecord": {},
"sqlite3VdbeAppendP4": {},
"sqlite3VdbeBooleanValue": {},
"sqlite3VdbeBytecodeVtabInit": {},
"sqlite3VdbeChangeEncoding": {},
"sqlite3VdbeChangeOpcode": {},
"sqlite3VdbeChangeP1": {},
@@ -770,6 +776,7 @@ var CAPI = map[string]struct{}{
"sqlite3VdbeMemFromBtree": {},
"sqlite3VdbeMemFromBtreeZeroOffset": {},
"sqlite3VdbeMemGrow": {},
"sqlite3VdbeMemHandleBom": {},
"sqlite3VdbeMemInit": {},
"sqlite3VdbeMemIntegerify": {},
"sqlite3VdbeMemMakeWriteable": {},
@@ -788,6 +795,7 @@ var CAPI = map[string]struct{}{
"sqlite3VdbeMemShallowCopy": {},
"sqlite3VdbeMemStringify": {},
"sqlite3VdbeMemTooBig": {},
"sqlite3VdbeMemTranslate": {},
"sqlite3VdbeMultiLoad": {},
"sqlite3VdbeNextOpcode": {},
"sqlite3VdbeOneByteSerialTypeLen": {},
@@ -942,6 +950,7 @@ var CAPI = map[string]struct{}{
"sqlite3_bind_parameter_name": {},
"sqlite3_bind_pointer": {},
"sqlite3_bind_text": {},
"sqlite3_bind_text16": {},
"sqlite3_bind_text64": {},
"sqlite3_bind_value": {},
"sqlite3_bind_zeroblob": {},
@@ -960,28 +969,35 @@ var CAPI = map[string]struct{}{
"sqlite3_close": {},
"sqlite3_close_v2": {},
"sqlite3_collation_needed": {},
"sqlite3_collation_needed16": {},
"sqlite3_column_blob": {},
"sqlite3_column_bytes": {},
"sqlite3_column_bytes16": {},
"sqlite3_column_count": {},
"sqlite3_column_decltype": {},
"sqlite3_column_decltype16": {},
"sqlite3_column_double": {},
"sqlite3_column_int": {},
"sqlite3_column_int64": {},
"sqlite3_column_name": {},
"sqlite3_column_name16": {},
"sqlite3_column_text": {},
"sqlite3_column_text16": {},
"sqlite3_column_type": {},
"sqlite3_column_value": {},
"sqlite3_commit_hook": {},
"sqlite3_compileoption_get": {},
"sqlite3_compileoption_used": {},
"sqlite3_complete": {},
"sqlite3_complete16": {},
"sqlite3_config": {},
"sqlite3_context_db_handle": {},
"sqlite3_create_collation": {},
"sqlite3_create_collation16": {},
"sqlite3_create_collation_v2": {},
"sqlite3_create_filename": {},
"sqlite3_create_function": {},
"sqlite3_create_function16": {},
"sqlite3_create_function_v2": {},
"sqlite3_create_module": {},
"sqlite3_create_module_v2": {},
@@ -999,6 +1015,7 @@ var CAPI = map[string]struct{}{
"sqlite3_db_release_memory": {},
"sqlite3_db_status": {},
"sqlite3_declare_vtab": {},
"sqlite3_deserialize": {},
"sqlite3_diskfull": {},
"sqlite3_diskfull_pending": {},
"sqlite3_drop_modules": {},
@@ -1006,6 +1023,7 @@ var CAPI = map[string]struct{}{
"sqlite3_enable_shared_cache": {},
"sqlite3_errcode": {},
"sqlite3_errmsg": {},
"sqlite3_errmsg16": {},
"sqlite3_errstr": {},
"sqlite3_exec": {},
"sqlite3_expanded_sql": {},
@@ -1061,6 +1079,7 @@ var CAPI = map[string]struct{}{
"sqlite3_mutex_try": {},
"sqlite3_next_stmt": {},
"sqlite3_open": {},
"sqlite3_open16": {},
"sqlite3_open_file_count": {},
"sqlite3_open_v2": {},
"sqlite3_opentemp_count": {},
@@ -1071,9 +1090,13 @@ var CAPI = map[string]struct{}{
"sqlite3_pager_writedb_count": {},
"sqlite3_pager_writej_count": {},
"sqlite3_prepare": {},
"sqlite3_prepare16": {},
"sqlite3_prepare16_v2": {},
"sqlite3_prepare16_v3": {},
"sqlite3_prepare_v2": {},
"sqlite3_prepare_v3": {},
"sqlite3_profile": {},
"sqlite3_progress_handler": {},
"sqlite3_randomness": {},
"sqlite3_realloc": {},
"sqlite3_realloc64": {},
@@ -1084,6 +1107,7 @@ var CAPI = map[string]struct{}{
"sqlite3_result_blob64": {},
"sqlite3_result_double": {},
"sqlite3_result_error": {},
"sqlite3_result_error16": {},
"sqlite3_result_error_code": {},
"sqlite3_result_error_nomem": {},
"sqlite3_result_error_toobig": {},
@@ -1093,12 +1117,16 @@ var CAPI = map[string]struct{}{
"sqlite3_result_pointer": {},
"sqlite3_result_subtype": {},
"sqlite3_result_text": {},
"sqlite3_result_text16": {},
"sqlite3_result_text16be": {},
"sqlite3_result_text16le": {},
"sqlite3_result_text64": {},
"sqlite3_result_value": {},
"sqlite3_result_zeroblob": {},
"sqlite3_result_zeroblob64": {},
"sqlite3_rollback_hook": {},
"sqlite3_search_count": {},
"sqlite3_serialize": {},
"sqlite3_set_authorizer": {},
"sqlite3_set_auxdata": {},
"sqlite3_set_last_insert_rowid": {},
@@ -1164,6 +1192,9 @@ var CAPI = map[string]struct{}{
"sqlite3_value_pointer": {},
"sqlite3_value_subtype": {},
"sqlite3_value_text": {},
"sqlite3_value_text16": {},
"sqlite3_value_text16be": {},
"sqlite3_value_text16le": {},
"sqlite3_value_type": {},
"sqlite3_version": {},
"sqlite3_vfs_find": {},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -157,15 +157,15 @@ func init() {
panic(fmt.Errorf("cannot allocate memory"))
}
*(*uintptr)(unsafe.Pointer(uintptr(varArgs))) = uintptr(unsafe.Pointer(&mutexMethods))
// int sqlite3_config(int, ...);
if rc := sqlite3.Xsqlite3_config(tls, sqlite3.SQLITE_CONFIG_MUTEX, uintptr(varArgs)); rc != sqlite3.SQLITE_OK {
if rc := sqlite3.Xsqlite3_config(tls, sqlite3.SQLITE_CONFIG_MUTEX, crt.VaList(varArgs, uintptr(unsafe.Pointer(&mutexMethods)))); rc != sqlite3.SQLITE_OK {
p := sqlite3.Xsqlite3_errstr(tls, rc)
str := crt.GoString(p)
panic(fmt.Errorf("sqlite: failed to configure mutex methods: %v", str))
}
crt.Xfree(tls, varArgs)
tls.Close()
sql.Register(driverName, newDriver())
}

View File

@@ -1,6 +1,78 @@
SQLite 2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd
103 errors out of 202628 tests on Linux 64-bit little-endian
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
@@ -12,8 +84,27 @@ check-3.2
check-3.4
check-3.6
collate1-6.1
corruptK-3.2
corruptK-3.3
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
@@ -22,25 +113,14 @@ crash8-4.8
crash8-4.10
ctime-1.4.3
ctime-2.1.3
dbpage-110
dbpage-120
dbpage-130
dbpage-140
dbpage-150
dbpage-160
dbpage-170
dbpage-200
dbpage-210
dbpage-220
dbpage-230
dbpage-240
dbpage-241
dbpage-250
dbpage-260
dbfuzz001-101a
dbfuzz001-110
dbfuzz001-200
dbfuzz001-320
dbfuzz001-330
eval-4.1
expr-13.8
expr-13.9
extension01-1.5
func-21.3
func-21.4
func-21.5
@@ -50,6 +130,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
@@ -64,20 +145,11 @@ lock2-1.10
lock4-1.2
lock4-1.3
lock4-999.1
numcast-utf8.0
numcast-utf16le.0
numcast-utf16be.0
pragma3-201
pragma3-400
pragma3-410
pragma3-420
pragma3-430
pragma4-1.12.1
resetdb-200
resetdb-201
resetdb-320
resetdb-330
resetdb-710
select6-3.2
shared9-3.2
shared9-3.4
@@ -96,8 +168,9 @@ tkt3841.1
tkt4018-1.3
tkt4018-1.4
tkt4018-2.2
trace3-8.7
update-15.1
utf16align-1.0
utf16align-1.2
vtab6-7.1
vtabH-3.0
wal2-12.2.2.4
@@ -106,10 +179,10 @@ 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 157968 max-size 100000016
Allocation count: now 0 max 1311119
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: 157968 bytes
Maximum memory usage: 807440 bytes
Current memory usage: 0 bytes
Number of malloc() : -1 calls