Skip to content

Commit 6d92aa1

Browse files
committed
SQLite 3.51.0.
1 parent 191d133 commit 6d92aa1

File tree

20 files changed

+68
-58
lines changed

20 files changed

+68
-58
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
version: '10.1'
113113
flags: '-test.v -test.short'
114114
- name: openbsd
115-
version: '7.7'
115+
version: '7.8'
116116
flags: '-test.v -test.short'
117117
runs-on: ubuntu-latest
118118
needs: test
@@ -128,7 +128,7 @@ jobs:
128128
run: .github/workflows/build-test.sh
129129

130130
- name: Test
131-
uses: cross-platform-actions/action@v0.29.0
131+
uses: cross-platform-actions/action@v0.30.0
132132
with:
133133
operating_system: ${{ matrix.os.name }}
134134
architecture: ${{ matrix.os.arch }}

conn.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -420,21 +420,21 @@ func busyCallback(ctx context.Context, mod api.Module, pDB ptr_t, count int32) (
420420
// Status retrieves runtime status information about a database connection.
421421
//
422422
// https://sqlite.org/c3ref/db_status.html
423-
func (c *Conn) Status(op DBStatus, reset bool) (current, highwater int, err error) {
423+
func (c *Conn) Status(op DBStatus, reset bool) (current, highwater int64, err error) {
424424
defer c.arena.mark()()
425-
hiPtr := c.arena.new(intlen)
426-
curPtr := c.arena.new(intlen)
425+
hiPtr := c.arena.new(8)
426+
curPtr := c.arena.new(8)
427427

428428
var i int32
429429
if reset {
430430
i = 1
431431
}
432432

433-
rc := res_t(c.call("sqlite3_db_status", stk_t(c.handle),
433+
rc := res_t(c.call("sqlite3_db_status64", stk_t(c.handle),
434434
stk_t(op), stk_t(curPtr), stk_t(hiPtr), stk_t(i)))
435435
if err = c.error(rc); err == nil {
436-
current = int(util.Read32[int32](c.mod, curPtr))
437-
highwater = int(util.Read32[int32](c.mod, hiPtr))
436+
current = util.Read64[int64](c.mod, curPtr)
437+
highwater = util.Read64[int64](c.mod, hiPtr)
438438
}
439439
return
440440
}

const.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ const (
234234
DBSTATUS_DEFERRED_FKS DBStatus = 10
235235
DBSTATUS_CACHE_USED_SHARED DBStatus = 11
236236
DBSTATUS_CACHE_SPILL DBStatus = 12
237-
// DBSTATUS_MAX DBStatus = 12
237+
DBSTATUS_TEMPBUF_SPILL DBStatus = 13
238+
// DBSTATUS_MAX DBStatus = 13
238239
)
239240

240241
// DBConfig are the available database connection configuration options.

embed/bcw2/bcw2.wasm

2.96 KB
Binary file not shown.

embed/bcw2/build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ cp "$ROOT"/sqlite3/*.[ch] build/
1515
cp "$ROOT"/sqlite3/*.patch build/
1616
cd sqlite/
1717

18-
# https://sqlite.org/src/info/ba2174bdca7d1d1a
19-
curl -#L https://github.com/sqlite/sqlite/archive/b46738f.tar.gz | tar xz --strip-components=1
20-
# curl -#L https://sqlite.org/src/tarball/sqlite.tar.gz?r=ba2174bdca | tar xz --strip-components=1
18+
# https://sqlite.org/src/info/0e862bc9ed7aa9ae
19+
curl -#L https://github.com/sqlite/sqlite/archive/0b99392.tar.gz | tar xz --strip-components=1
20+
# curl -#L https://sqlite.org/src/tarball/sqlite.tar.gz?r=0e862bc9ed | tar xz --strip-components=1
2121

2222
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then
2323
MSYS_NO_PATHCONV=1 nmake /f makefile.msc sqlite3.c "OPTS=-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT -DSQLITE_ENABLE_ORDERED_SET_AGGREGATES"
@@ -67,4 +67,4 @@ cd ~-
6767
--enable-mutable-globals --enable-nontrapping-float-to-int \
6868
--enable-simd --enable-bulk-memory --enable-sign-ext \
6969
--enable-reference-types --enable-multivalue \
70-
--strip --strip-producers
70+
--strip --strip-producers

embed/exports.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ sqlite3_db_filename
5959
sqlite3_db_name
6060
sqlite3_db_readonly
6161
sqlite3_db_release_memory
62-
sqlite3_db_status
62+
sqlite3_db_status64
6363
sqlite3_declare_vtab
6464
sqlite3_errcode
6565
sqlite3_errmsg

embed/init_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func Test_init(t *testing.T) {
1919
if err != nil {
2020
t.Fatal(err)
2121
}
22-
if version != "3.50.4" {
22+
if version != "3.51.0" {
2323
t.Error(version)
2424
}
2525
}

embed/sqlite3.wasm

7.59 KB
Binary file not shown.

internal/util/module.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,16 @@ func NewContext(ctx context.Context) context.Context {
2626
}
2727

2828
func GetSystemError(ctx context.Context) error {
29-
s := ctx.Value(moduleKey{}).(*moduleState)
30-
return s.sysError
29+
// Test needed to simplify testing.
30+
s, ok := ctx.Value(moduleKey{}).(*moduleState)
31+
if ok {
32+
return s.sysError
33+
}
34+
return nil
3135
}
3236

3337
func SetSystemError(ctx context.Context, err error) {
38+
// Test needed to simplify testing.
3439
s, ok := ctx.Value(moduleKey{}).(*moduleState)
3540
if ok {
3641
s.sysError = err

sqlite3/busy_timeout.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# handle, and interrupt, sqlite3_busy_timeout.
33
--- sqlite3.c.orig
44
+++ sqlite3.c
5-
@@ -184474,7 +184474,7 @@
5+
@@ -186667,7 +186667,7 @@
66
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
77
#endif
88
if( ms>0 ){

0 commit comments

Comments
 (0)