Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion versions/18/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ WASM_STACK_SIZE ?= 33554432
# byte-for-byte. Set in package.json `x-publish` and applied by copy:templates.
LIBPG_QUERY_REPO := https://github.com/constructive-io/libpg_query.git
LIBPG_QUERY_TAG := 18-constructive
LIBPG_QUERY_COMMIT := f75f8010a8a75fe4645db550c5f8f435dbc938a3
LIBPG_QUERY_COMMIT := 7791971be1fc169d3f1b0d1ec887dc3f134ad134

CACHE_DIR := .cache

Expand Down
2 changes: 1 addition & 1 deletion versions/18/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"distTag": "pg18",
"libpgQueryRepo": "https://github.com/constructive-io/libpg_query.git",
"libpgQueryTag": "18-constructive",
"libpgQueryCommit": "f75f8010a8a75fe4645db550c5f8f435dbc938a3",
"libpgQueryCommit": "7791971be1fc169d3f1b0d1ec887dc3f134ad134",
"fullApi": true
},
"files": [
Expand Down
14 changes: 14 additions & 0 deletions versions/18/test/wasm-recovery.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ describe('Recovery after the WASM parser throws', { timeout: 120000 }, () => {
assert.equal(parseSync('SELECT 1').stmts.length, 1);
});

// 18.2.x left the WASM build at the 100kB default limit, so it rejected nesting
// that 18.1.x and native builds parse.
it('parses nesting within the stack depth limit', async () => {
await loadModule();
const nested = {
'chained operators': 'SELECT 1' + '+1'.repeat(2000),
'nested subqueries': 'SELECT ' + '(SELECT '.repeat(1000) + '1' + ')'.repeat(1000),
'nested function calls': 'SELECT ' + 'f('.repeat(2000) + '1' + ')'.repeat(2000),
};
for (const [name, sql] of Object.entries(nested)) {
assert.equal(parseSync(sql).stmts.length, 1, name);
}
});

it('frees replaced WASM heaps even when callers keep the errors', () => {
const script = `const lib = require(${JSON.stringify(require.resolve('../wasm/index.cjs'))});
(async () => {
Expand Down
Loading