Increase various limits, fix #45.

This commit is contained in:
Nuno Cruces
2023-12-21 15:08:19 +00:00
parent cb62771a45
commit 89202629ec
6 changed files with 7 additions and 7 deletions

View File

@@ -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

Binary file not shown.

View File

@@ -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 {

View File

@@ -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,

View File

@@ -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
)

View File

@@ -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)