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

File urls with double leading slashes cause "SQL logic error: out of memory" #37

Open
CodingDoug opened this issue Jun 15, 2023 · 0 comments
Assignees

Comments

@CodingDoug
Copy link
Contributor

CodingDoug commented Jun 15, 2023

var dbUrl = "file://tmp/test.db"

db, err := sql.Open("libsql", dbUrl)
if err != nil {
	fmt.Fprintf(os.Stderr, "failed to open db %s: %s", dbUrl, err)
	os.Exit(1)
}

rows, err := db.Query("select 1")
if err != nil {
	fmt.Fprintf(os.Stderr, "failed to execute statement: %s", err)
	os.Exit(1)
}

The error happens on Query (not the Open!) This does not happen when the file URL is "file:/tmp/test.db" or "file:///tmp/test.db"

The TypeScript driver documents that two leading slashes is not a valid URL, which is fine. We just need a more sensible error message about it, and preferably during Open and not Query.

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

No branches or pull requests

2 participants