Title: sqlite: re-filtering a virtual-table cursor skips generator cleanup · Issue #66193 · nodejs/node · GitHub
Open Graph Title: sqlite: re-filtering a virtual-table cursor skips generator cleanup · Issue #66193 · nodejs/node
X Title: sqlite: re-filtering a virtual-table cursor skips generator cleanup · Issue #66193 · nodejs/node
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: '...
Open Graph 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('...
X 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; d...
Opengraph URL: https://github.com/nodejs/node/issues/66193
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sqlite: re-filtering a virtual-table cursor skips generator cleanup","articleBody":"### Version\n\nmain\n\n### Platform\n\n```text\nN/A\n```\n\n### Subsystem\n\nsqlite\n\n### What steps will reproduce the bug?\n\n```js\nimport { DatabaseSync } from 'node:sqlite';\n\nconst db = new DatabaseSync(':memory:');\n\nlet cleaned = 0;\ndb.createModule('m', {\n columns: [{ name: 'input', type: 'INTEGER', hidden: true }],\n *rows(input) {\n try { yield [input]; } finally { cleaned++; }\n },\n});\n\ndb.exec('CREATE TABLE t(a); INSERT INTO t VALUES (1), (2)');\ndb.prepare('SELECT a FROM t WHERE EXISTS(SELECT 1 FROM m(t.a))').all();\nconsole.log(cleaned); // 1, expected 2\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways\n\n### What is the expected behavior? Why is that the expected behavior?\n\nBoth `rows()` calls (for `t.a = 1` and `t.a = 2`) run their `finally`, so `cleaned` is `2`.\n\n### What do you see instead?\n\n`cleaned` is `1`; the first generator is suspended and discarded by the re-filter and its `finally` never runs.\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-09-22T05:28:13Z","url":"https://github.com/nodejs/node/issues/66193"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1cff7c7b-0c2a-8197-87bf-e5ce95564d08 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8DA8:20C6D9:9DE8CD:D1E341:6AED3157 |
| html-safe-nonce | add5cfd60b6726b44f91b26ae62ee9f33cdfa44eae426ec562b6d90902db2f66 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4REE4OjIwQzZEOTo5REU4Q0Q6RDFFMzQxOjZBRUQzMTU3IiwidmlzaXRvcl9pZCI6IjY5NDI5ODY4MzcxNjIxOTIyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4d18ea9340799605993692f557bd251d07d243f4c0d26e1b28ccaace30987fe1 |
| hovercard-subject-tag | issue:5535640817 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/66193/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ff3477d6e239ee6eade5c0bc67380f173653ec96c24311b7365000feebf8bd1a/nodejs/node/issues/66193 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ff3477d6e239ee6eade5c0bc67380f173653ec96c24311b7365000feebf8bd1a/nodejs/node/issues/66193 |
| og:image:alt | 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('... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | trivikr |
| hostname | github.com |
| expected-hostname | github.com |
| None | e51d0b7b5ab34b1688c05b54c3ed17b8658b2fa9bca973a9c740683ccb12cf4a |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 59ebb7b901cc154ecc179a44f266fcf69f343b30 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width