sql-js / sql-js/sql.js

Getting an error on Memory access out of bounds when trying to run db.exec with a large query string

Open
#571 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.7k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

When creating the database initially, we use a large file that is successfully processed to create the database.
Afterwards, when we attampt to run a script to add another table, it is throw the error Memory access out of bounds.

This always happens when the query string is about 1.5MB.
When the query is below that size, the query is successfully processed and the database is updated with the new table.

Is there a limit to much much the query string should be big?

This is was done Google Chrome browser version 120.0.6099.224 64bits
On SQL.js library version ^1.8.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure in Google Chrome with SQL.js 1.8.0 using a db.exec query around 1.5 MB, then compare it with a smaller query that succeeds. Determine whether the behavior is a documented query-size limit or a defect, and document the limit or provide a verified fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, sqlite, wasm
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.