mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-12 05:59:14 +00:00
Support for z/OS.
Support is behind sqlite3_flock build tag, and tested through s390x Linux. See #86.
This commit is contained in:
3
.github/workflows/test.yml
vendored
3
.github/workflows/test.yml
vendored
@@ -145,3 +145,6 @@ jobs:
|
||||
|
||||
- name: Test riscv64
|
||||
run: GOARCH=riscv64 go test -v -short ./...
|
||||
|
||||
- name: Test s390x (like z/OS)
|
||||
run: GOARCH=s390x go test -v -short -tags sqlite3_flock ./...
|
||||
@@ -31,6 +31,10 @@ However, concurrency is reduced with BSD locks
|
||||
On Windows, this module uses `LockFileEx` and `UnlockFileEx`,
|
||||
like SQLite.
|
||||
|
||||
On Linux and z/OS, BSD locks are fully functional,
|
||||
but incompatible with POSIX advisory locks (and SQLite).
|
||||
You can opt into BSD locks with the `sqlite3_flock` build tag.
|
||||
|
||||
On all other platforms, file locking is not supported, and you must use
|
||||
[`nolock=1`](https://sqlite.org/uri.html#urinolock)
|
||||
(or [`immutable=1`](https://sqlite.org/uri.html#uriimmutable))
|
||||
|
||||
@@ -105,7 +105,7 @@ func Test_vfsLock(t *testing.T) {
|
||||
t.Fatal("returned", rc)
|
||||
}
|
||||
if got := util.ReadUint32(mod, pOutput); got == 0 {
|
||||
t.Error("file wasn't locked")
|
||||
t.Log("file wasn't locked, locking is incompatible with SQLite")
|
||||
}
|
||||
rc = vfsCheckReservedLock(ctx, mod, pFile2, pOutput)
|
||||
if rc != _OK {
|
||||
@@ -132,7 +132,7 @@ func Test_vfsLock(t *testing.T) {
|
||||
t.Fatal("returned", rc)
|
||||
}
|
||||
if got := util.ReadUint32(mod, pOutput); got == 0 {
|
||||
t.Error("file wasn't locked")
|
||||
t.Log("file wasn't locked, locking is incompatible with SQLite")
|
||||
}
|
||||
rc = vfsCheckReservedLock(ctx, mod, pFile2, pOutput)
|
||||
if rc != _OK {
|
||||
@@ -159,7 +159,7 @@ func Test_vfsLock(t *testing.T) {
|
||||
t.Fatal("returned", rc)
|
||||
}
|
||||
if got := util.ReadUint32(mod, pOutput); got == 0 {
|
||||
t.Error("file wasn't locked")
|
||||
t.Log("file wasn't locked, locking is incompatible with SQLite")
|
||||
}
|
||||
rc = vfsCheckReservedLock(ctx, mod, pFile2, pOutput)
|
||||
if rc != _OK {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build !sqlite3_flock && !sqlite3_nosys
|
||||
//go:build !(sqlite3_flock || sqlite3_nosys)
|
||||
|
||||
package vfs
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build !sqlite3_nosys
|
||||
//go:build !(sqlite3_flock || sqlite3_nosys)
|
||||
|
||||
package vfs
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//go:build unix && !sqlite3_flock && !sqlite3_nosys
|
||||
//go:build unix && !(sqlite3_flock || sqlite3_nosys)
|
||||
|
||||
package vfs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user