Comments (7)
I tried here quolpr@7c0d9bd , but it didn't help. I suspect that this error is about JS VM stack error 🤔
from wa-sqlite.
This isn't a valid SQL(ite) statement, right? Not that it should produce a stack overflow, but I'm wondering if that is part of what triggers the issue.
Nope, it's valid. You can run it with not asyncify build, or you can also paste it to here https://sql.js.org/examples/GUI/ . For me, it even fails with 1...100 range (in the example I used 1...200 VALUES).
I used VALUES
in one of my queries and now instead I use CTE like here https://til.simonwillison.net/sqlite/cte-values
from wa-sqlite.
I'm going to mark this WONTFIX. I don't see a compelling reason to use nested VALUES in this way causing the deep recursion here. And unfortunately, even if there is a good reason to do this, the "obvious" ways that Emscripten provides to tune the stack size don't seem to have any effect.
from wa-sqlite.
Can you try:
- Increasing the stack size in the Makefile, or
- Removing SQLITE_USE_ALLOCA from the Makefile
Then rebuild the WASM artifacts. You would need to follow the build instructions on the README. If you don't have the time or the background, I'll get around to it at some point.
from wa-sqlite.
I also made the debug build, and it seems just fail to parse the query:
The bad things about this are that for iOS Safari it seems the stack size is not so big and sometime prepare fails even for simple query like CREATE TABLE ...
.
And yeah, the weird thing is that the first run doesn't fail 🤔
from wa-sqlite.
Thanks for taking a look! I'm puzzled because I really thought one of those changes would fix it. I'll investigate myself when I can.
This isn't a valid SQL(ite) statement, right? Not that it should produce a stack overflow, but I'm wondering if that is part of what triggers the issue.
from wa-sqlite.
Thanks, I never knew you could use a bare VALUES clause as a statement. Is there a reason you need so many VALUES, as opposed to just:
VALUES (0), (1), (2), ...
The internal functions sqlite3Select()
and multiSelect()
are mutually recursive, as your debug build stack trace shows, and every VALUES starts a new subquery and introduces another level of recursion.
I think that explains why you're putting so much pressure on the stack, though it doesn't explain why it won't fail on the first try or with dev tools open.
from wa-sqlite.
Related Issues (20)
- Support concurrent access to multiple databases HOT 3
- RuntimeError: memory access out of bounds - IDBBatchAtomicVFS HOT 5
- Racy IDBBatchAtomicVFS behavior when calling methods directly HOT 6
- PRAGMA synchronous=0; causes `database disk image is malformed` for `IDBBatchAtomic` VFS HOT 4
- Replace sqlite with libsql
- Corruption in vlcn fork with FTS5 HOT 8
- IDBBatchAtomicVFS error: `TypeError: Cannot read properties of null (reading 'fileSize')` HOT 4
- Strange error stack trace: both "SQL error" and "journal file not found" HOT 7
- Trigger on multiple tabs HOT 3
- Slow Query Execution for Tables with Diverse Data HOT 1
- Error: database disk image is malformed HOT 10
- Error: no such module: rtree HOT 2
- Feature request: add last_insert_rowid method
- sqlite3.exec throws "RuntimeError: memory access out of bounds" HOT 11
- Yarn install `Packing the package failed exit code 1` HOT 2
- Empty blobs as bind parameters being returned as NULLs HOT 2
- Full text support HOT 2
- Which VFS is the best?
- Example VFS locking can have name collisions across filesystems HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wa-sqlite.