mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-11 21:49:13 +00:00
Increase various limits, fix #45.
This commit is contained in:
2
const.go
2
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
|
||||
|
||||
Binary file not shown.
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
2
vtab.go
2
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)
|
||||
|
||||
Reference in New Issue
Block a user