Title: sqlite virtual table silently returns empty rows for unavailable join parameters · Issue #66214 · nodejs/node · GitHub
Open Graph Title: sqlite virtual table silently returns empty rows for unavailable join parameters · Issue #66214 · nodejs/node
X Title: sqlite virtual table silently returns empty rows for unavailable join parameters · Issue #66214 · nodejs/node
Description: Version main Platform All Subsystem sqlite What steps will reproduce the bug? import { DatabaseSync } from 'node:sqlite'; const db = new DatabaseSync(':memory:'); db.createModule('m', { columns: [ { name: 'value', type: 'INTEGER' }, { na...
Open Graph Description: Version main Platform All Subsystem sqlite What steps will reproduce the bug? import { DatabaseSync } from 'node:sqlite'; const db = new DatabaseSync(':memory:'); db.createModule('m', { columns: [ ...
X Description: Version main Platform All Subsystem sqlite What steps will reproduce the bug? import { DatabaseSync } from 'node:sqlite'; const db = new DatabaseSync(':memory:'); db.createModule(...
Opengraph URL: https://github.com/nodejs/node/issues/66214
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sqlite virtual table silently returns empty rows for unavailable join parameters","articleBody":"### Version\n\nmain\n\n### Platform\n\n```text\nAll\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\ndb.createModule('m', {\n columns: [\n { name: 'value', type: 'INTEGER' },\n { name: 'a', type: 'INTEGER', hidden: true },\n ],\n *rows(a) { if (a !== null) yield [a]; },\n});\n\ndb.exec('CREATE TABLE t (a INTEGER)');\ndb.exec('INSERT INTO t VALUES (1), (2), (3)');\n\nconsole.log(db.prepare('SELECT DISTINCT * FROM m(t.a) JOIN t ON t.a = m.a').all());\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\nPer SQLite's [Enforcing Required Parameters On Table-Valued Functions](https://www.sqlite.org/vtab.html#enforcing_required_parameters_on_table_valued_functions), `xBestIndex()` must return `SQLITE_CONSTRAINT` when a parameter has an EQ constraint whose `usable` flag is false, so the planner picks an ordering where the parameter is available. Cost estimates alone cannot enforce parameter dependencies.\n\n### What do you see instead?\n\n`rows()` is called with `null` and the query returns `[]`. `xBestIndex()` skips constraints with `usable == false`, accepts the unconstrained plan, and `xFilter()` passes `Null(isolate)`.\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-09-22T23:22:25Z","url":"https://github.com/nodejs/node/issues/66214"}
| 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:3a09c3d4-8fb3-565b-a99d-058e3ed070dc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EBA0:12AE65:6E5F38:8F542D:6AED2F91 |
| html-safe-nonce | 54b4dac5ebfc0fed67901897e57870487622a2e8da59ed24e318eaf21599bc9a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQkEwOjEyQUU2NTo2RTVGMzg6OEY1NDJEOjZBRUQyRjkxIiwidmlzaXRvcl9pZCI6IjU4MjEwMzE0MTY0MzM4MTU0NDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ed8faa597c380585f69d215da5e62963c43ee948624e6ab246044e820363e4f8 |
| hovercard-subject-tag | issue:5546513305 |
| 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/66214/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b7e6490f574f9dfbab41c023d79c1e2c6fdb1a1b295242978316976fb61d3cbc/nodejs/node/issues/66214 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b7e6490f574f9dfbab41c023d79c1e2c6fdb1a1b295242978316976fb61d3cbc/nodejs/node/issues/66214 |
| og:image:alt | Version main Platform All Subsystem sqlite What steps will reproduce the bug? import { DatabaseSync } from 'node:sqlite'; const db = new DatabaseSync(':memory:'); db.createModule('m', { columns: [ ... |
| 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