duckdb / duckdb-wasm

WebAssembly version of DuckDB
https://shell.duckdb.org
MIT License
1.02k stars 110 forks source link

Handle longer queries #1768

Closed carlopi closed 2 weeks ago

carlopi commented 2 weeks ago

duckdb_web_query_run implicitly relied on stack-allocated strings for handling ccall Emscripten mechanisms.

Move to explicit allocations in the HEAPU8 buffer and passing around only pointers.

Before this fix queries at around 64K would become buggy, now up to 1e7, possibly even more can be handled.

This fixes a long standing issue in https://github.com/duckdb/duckdb-wasm/issues/1477

carlopi commented 2 weeks ago

@antonycourtney to be credited with the parametrisable test, thanks.

antonycourtney commented 2 weeks ago

Awesome that you tracked this down, @carlopi ! Can't wait to get this fix into MotherDuck!