Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the Prepare/Close crash #15

Open
djthorpe opened this issue Oct 4, 2021 · 1 comment
Open

Fix the Prepare/Close crash #15

djthorpe opened this issue Oct 4, 2021 · 1 comment
Assignees
Labels

Comments

@djthorpe
Copy link
Member

djthorpe commented Oct 4, 2021

A crash (probably from the Pool) when clearly a close is not paired with a prepare for a connection.

@djthorpe djthorpe self-assigned this Oct 4, 2021
@djthorpe djthorpe added the bug label Oct 4, 2021
@djthorpe
Copy link
Member Author

djthorpe commented Oct 4, 2021

There are two issues. The prepared statement cache is not working:

go clean -testcache && go test -v ./pkg/sqlite3 -run Test_Cache_001

The results can return bad information. Opening with connection without the SQLITE_OPEN_CACHE flag fixes this, so it's definately the cache.

Secondly,

go clean -testcache && go test -v ./pkg/sqlite3 -run Test_Pool_002

Can sometimes return a Prepare/Close panic.

panic: /home/djt/projects/go-sqlite/pkg/sqlite3/cache.go:49: Prepare() missing call to Close()

goroutine 20 [running]:
github.com/mutablelogic/go-sqlite/sys/sqlite3.(*ConnEx).Prepare.func1(0x2491d00)
	/home/djt/projects/go-sqlite/sys/sqlite3/statementex.go:50 +0xc8
FAIL	github.com/mutablelogic/go-sqlite/pkg/sqlite3	1.843s

Exhibits under higher loads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant