sqlite: re-filtering a virtual-table cursor skips generator cleanup
@trivikr is already working on this.
Since Sep 22, 2026.
Assessment
This issue has not been assessed yet.
Description
Version
main
Platform
N/A
Subsystem
sqlite
What steps will reproduce the bug?
import { DatabaseSync } from 'node:sqlite';
const db = new DatabaseSync(':memory:');
let cleaned = 0;
db.createModule('m', {
columns: [{ name: 'input', type: 'INTEGER', hidden: true }],
*rows(input) {
try { yield [input]; } finally { cleaned++; }
},
});
db.exec('CREATE TABLE t(a); INSERT INTO t VALUES (1), (2)');
db.prepare('SELECT a FROM t WHERE EXISTS(SELECT 1 FROM m(t.a))').all();
console.log(cleaned); // 1, expected 2
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
Both rows() calls (for t.a = 1 and t.a = 2) run their finally, so cleaned is 2.
What do you see instead?
cleaned is 1; the first generator is suspended and discarded by the re-filter and its finally never runs.
Additional information
No response
- Dominant language
- JavaScript
- Stars
- 122k
- Forks
- 37.4k
- Avg merge
- 4d 4h
- Merged PRs (30d)
- 276
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nodejs/node
-
doc
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
build
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
feature request
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Similar issues
-
bug customer-eng Durable Agents Inngest status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
githubnext/gh-aw-cao#13475 ·
-
[BUG]: "Clear All" in Settings doesn't clear the saved analysis, old data comes back after reload Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
AOSSIE-Org/OrgExplorer#253 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
oxc-project/oxc#26944 ·
-
ai-observability bug team/ai-observability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100