Skip to content

Commit cf14f19

Browse files
committed
SQLite 3.47.1.
1 parent 6ca92b0 commit cf14f19

File tree

22 files changed

+56
-41
lines changed

22 files changed

+56
-41
lines changed

.github/workflows/repro.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [[ "$OSTYPE" == "linux"* ]]; then
55
WASI_SDK="https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-24/wasi-sdk-24.0-x86_64-linux.tar.gz"
66
BINARYEN="https://github.com/WebAssembly/binaryen/releases/download/version_120/binaryen-version_120-x86_64-linux.tar.gz"
77
elif [[ "$OSTYPE" == "darwin"* ]]; then
8-
WASI_SDK="https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-24/wasi-sdk-24.0-x86_64-macos.tar.gz"
8+
WASI_SDK="https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-24/wasi-sdk-24.0-arm64-macos.tar.gz"
99
BINARYEN="https://github.com/WebAssembly/binaryen/releases/download/version_120/binaryen-version_120-arm64-macos.tar.gz"
1010
elif [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then
1111
WASI_SDK="https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-24/wasi-sdk-24.0-x86_64-windows.tar.gz"

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ on:
55
branches: [ "main" ]
66
paths:
77
- '**.go'
8+
- '**.mod'
89
- '**.wasm'
910
- '**.wasm.bz2'
1011
pull_request:
1112
branches: [ "main" ]
1213
paths:
1314
- '**.go'
15+
- '**.mod'
1416
- '**.wasm'
1517
- '**.wasm.bz2'
1618
workflow_dispatch:

embed/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Embeddable Wasm build of SQLite
22

3-
This folder includes an embeddable Wasm build of SQLite 3.47.0 for use with
3+
This folder includes an embeddable Wasm build of SQLite 3.47.1 for use with
44
[`github.com/ncruces/go-sqlite3`](https://pkg.go.dev/github.com/ncruces/go-sqlite3).
55

66
The following optional features are compiled in:

embed/bcw2/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Embeddable Wasm build of SQLite
22

3-
This folder includes an embeddable Wasm build of SQLite 3.47.0, including the experimental
3+
This folder includes an embeddable Wasm build of SQLite, including the experimental
44
[`BEGIN CONCURRENT`](https://sqlite.org/src/doc/begin-concurrent/doc/begin_concurrent.md) and
55
[Wal2](https://sqlite.org/cgi/src/doc/wal2/doc/wal2.md) patches.
66

embed/bcw2/bcw2.wasm

789 Bytes
Binary file not shown.

embed/bcw2/bcw2_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func Test_bcw2(t *testing.T) {
4242
if err != nil {
4343
t.Fatal(err)
4444
}
45-
if version != "3.47.0" {
45+
if version != "3.48.0" {
4646
t.Error(version)
4747
}
4848
}

embed/bcw2/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ mkdir -p build/ext/
1313
cp "$ROOT"/sqlite3/*.[ch] build/
1414
cp "$ROOT"/sqlite3/*.patch build/
1515

16-
# https://sqlite.org/src/info/d2d954d43abe20a3
17-
curl -# https://sqlite.org/src/tarball/sqlite.tar.gz?r=d2d954d4 | tar xz
16+
# https://sqlite.org/src/info/e03dd0bd313817da
17+
curl -# https://sqlite.org/src/tarball/sqlite.tar.gz?r=e03dd0bd | tar xz
1818

1919
cd sqlite
2020
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then

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.47.0" {
22+
if version != "3.47.1" {
2323
t.Error(version)
2424
}
2525
}

embed/sqlite3.wasm

205 Bytes
Binary file not shown.

gormlite/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/jinzhu/inflection v1.0.0 // indirect
1414
github.com/jinzhu/now v1.1.5 // indirect
1515
github.com/ncruces/julianday v1.0.0 // indirect
16-
github.com/tetratelabs/wazero v1.8.1 // indirect
16+
github.com/tetratelabs/wazero v1.8.2 // indirect
1717
golang.org/x/sys v0.27.0 // indirect
1818
golang.org/x/text v0.20.0 // indirect
1919
)

gormlite/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ github.com/ncruces/go-sqlite3 v0.20.2 h1:cMLIwrLZQuCWVCEOowSqlIlpzgbag3jnYVW4NM5
66
github.com/ncruces/go-sqlite3 v0.20.2/go.mod h1:yL4ZNWGsr1/8pcLfpPW1RT1WFdvyeHonrgIwwi4rvkg=
77
github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt7M=
88
github.com/ncruces/julianday v1.0.0/go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g=
9-
github.com/tetratelabs/wazero v1.8.1 h1:NrcgVbWfkWvVc4UtT4LRLDf91PsOzDzefMdwhLfA550=
10-
github.com/tetratelabs/wazero v1.8.1/go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs=
9+
github.com/tetratelabs/wazero v1.8.2 h1:yIgLR/b2bN31bjxwXHD8a3d+BogigR952csSDdLYEv4=
10+
github.com/tetratelabs/wazero v1.8.2/go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs=
1111
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
1212
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
1313
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=

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-
@@ -182908,7 +182908,7 @@
5+
@@ -182928,7 +182928,7 @@
66
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
77
#endif
88
if( ms>0 ){

sqlite3/download.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -euo pipefail
33

44
cd -P -- "$(dirname -- "$0")"
55

6-
curl -#OL "https://sqlite.org/2024/sqlite-amalgamation-3470000.zip"
6+
curl -#OL "https://sqlite.org/2024/sqlite-amalgamation-3470100.zip"
77
unzip -d . sqlite-amalgamation-*.zip
88
mv sqlite-amalgamation-*/sqlite3.c .
99
mv sqlite-amalgamation-*/sqlite3.h .
@@ -21,25 +21,25 @@ cat *.patch | patch --no-backup-if-mismatch
2121

2222
mkdir -p ext/
2323
cd ext/
24-
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.0/ext/misc/anycollseq.c"
25-
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.0/ext/misc/base64.c"
26-
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.0/ext/misc/decimal.c"
27-
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.0/ext/misc/ieee754.c"
28-
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.0/ext/misc/regexp.c"
29-
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.0/ext/misc/series.c"
30-
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.0/ext/misc/spellfix.c"
31-
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.0/ext/misc/uint.c"
24+
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.1/ext/misc/anycollseq.c"
25+
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.1/ext/misc/base64.c"
26+
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.1/ext/misc/decimal.c"
27+
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.1/ext/misc/ieee754.c"
28+
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.1/ext/misc/regexp.c"
29+
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.1/ext/misc/series.c"
30+
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.1/ext/misc/spellfix.c"
31+
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.1/ext/misc/uint.c"
3232
cd ~-
3333

3434
cd ../vfs/tests/mptest/testdata/
35-
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.0/mptest/mptest.c"
36-
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.0/mptest/config01.test"
37-
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.0/mptest/config02.test"
38-
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.0/mptest/crash01.test"
39-
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.0/mptest/crash02.subtest"
40-
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.0/mptest/multiwrite01.test"
35+
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.1/mptest/mptest.c"
36+
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.1/mptest/config01.test"
37+
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.1/mptest/config02.test"
38+
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.1/mptest/crash01.test"
39+
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.1/mptest/crash02.subtest"
40+
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.1/mptest/multiwrite01.test"
4141
cd ~-
4242

4343
cd ../vfs/tests/speedtest1/testdata/
44-
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.0/test/speedtest1.c"
44+
curl -#OL "https://github.com/sqlite/sqlite/raw/version-3.47.1/test/speedtest1.c"
4545
cd ~-

sqlite3/vfs_find.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Remove VFS registration. Go handles it.
22
--- sqlite3.c.orig
33
+++ sqlite3.c
4-
@@ -26594,7 +26594,7 @@
4+
@@ -26603,7 +26603,7 @@
55
sqlite3_free(p);
66
return sqlite3_os_init();
77
}
@@ -10,7 +10,7 @@
1010
/*
1111
** The list of all registered VFS implementations.
1212
*/
13-
@@ -26691,7 +26691,7 @@
13+
@@ -26700,7 +26700,7 @@
1414
sqlite3_mutex_leave(mutex);
1515
return SQLITE_OK;
1616
}

vfs/adiantum/hbsh.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,13 @@ func (h *hbshFile) WriteAt(p []byte, off int64) (n int, err error) {
198198
func (h *hbshFile) DeviceCharacteristics() vfs.DeviceCharacteristic {
199199
var _ [0]struct{} = [blockSize - 4096]struct{}{} // Ensure blockSize is 4K.
200200
return h.File.DeviceCharacteristics() & (0 |
201-
// The only safe flags are these:
201+
// These flags are safe:
202202
vfs.IOCAP_ATOMIC4K |
203-
vfs.IOCAP_UNDELETABLE_WHEN_OPEN |
204203
vfs.IOCAP_IMMUTABLE |
205-
vfs.IOCAP_BATCH_ATOMIC)
204+
vfs.IOCAP_SEQUENTIAL |
205+
vfs.IOCAP_SUBPAGE_READ |
206+
vfs.IOCAP_BATCH_ATOMIC |
207+
vfs.IOCAP_UNDELETABLE_WHEN_OPEN)
206208
}
207209

208210
func (h *hbshFile) SectorSize() int {

vfs/cksm.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ func (c cksmFile) Pragma(name string, value string) (string, error) {
101101
return "", _NOTFOUND
102102
}
103103

104+
func (c cksmFile) DeviceCharacteristics() DeviceCharacteristic {
105+
res := c.File.DeviceCharacteristics()
106+
if c.verifyCksm {
107+
res &^= IOCAP_SUBPAGE_READ
108+
}
109+
return res
110+
}
111+
104112
func (c cksmFile) fileControl(ctx context.Context, mod api.Module, op _FcntlOpcode, pArg uint32) _ErrorCode {
105113
switch op {
106114
case _FCNTL_CKPT_START:

vfs/const.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ const (
177177
IOCAP_POWERSAFE_OVERWRITE DeviceCharacteristic = 0x00001000
178178
IOCAP_IMMUTABLE DeviceCharacteristic = 0x00002000
179179
IOCAP_BATCH_ATOMIC DeviceCharacteristic = 0x00004000
180+
IOCAP_SUBPAGE_READ DeviceCharacteristic = 0x00008000
180181
)
181182

182183
// https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html

vfs/file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func (f *vfsFile) SectorSize() int {
187187
}
188188

189189
func (f *vfsFile) DeviceCharacteristics() DeviceCharacteristic {
190-
var res DeviceCharacteristic
190+
res := IOCAP_SUBPAGE_READ
191191
if osBatchAtomic(f.File) {
192192
res |= IOCAP_BATCH_ATOMIC
193193
}

vfs/readervfs/reader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,5 @@ func (readerFile) SectorSize() int {
7777
}
7878

7979
func (readerFile) DeviceCharacteristics() vfs.DeviceCharacteristic {
80-
return vfs.IOCAP_IMMUTABLE
80+
return vfs.IOCAP_IMMUTABLE | vfs.IOCAP_SUBPAGE_READ
8181
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:4a2ed4f7fe323843e78c59a23e0bd078d807745a3e6276a9862ff08bb7bdac18
3-
size 480769
2+
oid sha256:802b6453e73f0e94773b93a0e5a7abfe427187e916a3258cd5093959def61bda
3+
size 480661
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:98abb49f1b6acf5398c08556571d44acdc7258484e510b3f8c7a19ee42b5821c
3-
size 493373
2+
oid sha256:7ba2fd84fb88e54f60280c41bc7389c946ef1abc5cb9c795bbb32bc0f5760c65
3+
size 493557

vfs/xts/xts.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,13 @@ func (x *xtsFile) WriteAt(p []byte, off int64) (n int, err error) {
194194
func (x *xtsFile) DeviceCharacteristics() vfs.DeviceCharacteristic {
195195
var _ [0]struct{} = [sectorSize - 512]struct{}{} // Ensure sectorSize is 512.
196196
return x.File.DeviceCharacteristics() & (0 |
197-
// The only safe flags are these:
197+
// These flags are safe:
198198
vfs.IOCAP_ATOMIC512 |
199-
vfs.IOCAP_UNDELETABLE_WHEN_OPEN |
200199
vfs.IOCAP_IMMUTABLE |
201-
vfs.IOCAP_BATCH_ATOMIC)
200+
vfs.IOCAP_SEQUENTIAL |
201+
vfs.IOCAP_SUBPAGE_READ |
202+
vfs.IOCAP_BATCH_ATOMIC |
203+
vfs.IOCAP_UNDELETABLE_WHEN_OPEN)
202204
}
203205

204206
func (x *xtsFile) SectorSize() int {

0 commit comments

Comments
 (0)