diff --git a/const.go b/const.go index 01c3451..e10430e 100644 --- a/const.go +++ b/const.go @@ -9,7 +9,7 @@ const ( _UTF8 = 1 - _MAX_NAME = 512 // Used for short strings: names, error messages… + _MAX_NAME = 1e6 // Self-imposed limit for most NUL terminated strings. _MAX_LENGTH = 1e9 _MAX_SQL_LENGTH = 1e9 _MAX_ALLOCATION_SIZE = 0x7ffffeff diff --git a/embed/sqlite3.wasm b/embed/sqlite3.wasm index 0b73eba..1d2b2f7 100755 Binary files a/embed/sqlite3.wasm and b/embed/sqlite3.wasm differ diff --git a/sqlite.go b/sqlite.go index 15bbf6e..e21881e 100644 --- a/sqlite.go +++ b/sqlite.go @@ -126,7 +126,7 @@ func (sqlt *sqlite) error(rc uint64, handle uint32, sql ...string) error { if handle != 0 { if r := sqlt.call("sqlite3_errmsg", uint64(handle)); r != 0 { - err.msg = util.ReadString(sqlt.mod, uint32(r), _MAX_NAME) + err.msg = util.ReadString(sqlt.mod, uint32(r), _MAX_LENGTH) } if sql != nil { diff --git a/sqlite3/vfs.c b/sqlite3/vfs.c index 24965e9..31558be 100644 --- a/sqlite3/vfs.c +++ b/sqlite3/vfs.c @@ -67,7 +67,7 @@ int sqlite3_os_init() { static sqlite3_vfs os_vfs = { .iVersion = 2, .szOsFile = sizeof(struct go_file), - .mxPathname = 512, + .mxPathname = 1024, .zName = "os", .xOpen = go_open_wrapper, @@ -113,7 +113,7 @@ sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName) { *go_vfs_list = (sqlite3_vfs){ .iVersion = 2, .szOsFile = sizeof(struct go_file), - .mxPathname = 512, + .mxPathname = 1024, .zName = name, .pNext = head, diff --git a/vfs/const.go b/vfs/const.go index 02e8f06..0a3c3ab 100644 --- a/vfs/const.go +++ b/vfs/const.go @@ -3,8 +3,8 @@ package vfs import "github.com/ncruces/go-sqlite3/internal/util" const ( - _MAX_NAME = 512 // Used for short strings: names, error messages… - _MAX_PATHNAME = 512 + _MAX_NAME = 1e6 // Self-imposed limit for most NUL terminated strings. + _MAX_PATHNAME = 1024 _DEFAULT_SECTOR_SIZE = 4096 ) diff --git a/vtab.go b/vtab.go index f5bddf7..f53610a 100644 --- a/vtab.go +++ b/vtab.go @@ -523,7 +523,7 @@ func cursorFilterCallback(ctx context.Context, mod api.Module, pCur, idxNum, idx args := callbackArgs(db, argc, argv) var idxName string if idxStr != 0 { - idxName = util.ReadString(mod, idxStr, _MAX_NAME) + idxName = util.ReadString(mod, idxStr, _MAX_LENGTH) } err := cursor.Filter(int(idxNum), idxName, args...) return vtabError(ctx, mod, pCur, _CURSOR_ERROR, err)