sqlite virtual table silently returns empty rows for unavailable join parameters
@trivikr がすでに取り組んでいます。
2026年9月22日 から。
評価
この issue はまだ評価されていません。
説明
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' },
{ name: 'a', type: 'INTEGER', hidden: true },
],
*rows(a) { if (a !== null) yield [a]; },
});
db.exec('CREATE TABLE t (a INTEGER)');
db.exec('INSERT INTO t VALUES (1), (2), (3)');
console.log(db.prepare('SELECT DISTINCT * FROM m(t.a) JOIN t ON t.a = m.a').all());
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
Per SQLite's 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.
What do you see instead?
rows() is called with null and the query returns []. xBestIndex() skips constraints with usable == false, accepts the unconstrained plan, and xFilter() passes Null(isolate).
Additional information
No response
- 主要言語
- JavaScript
- スター
- 122k
- フォーク
- 37.4k
- 平均マージ
- 4日 2時間
- マージ済み PR(30日)
- 277
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nodejs/node のほかの issue
-
doc
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
build
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
feature request
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
似ている issue
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Automattic/safe-publish#594 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
dream-num/dsh-univer-office#104 ·
-
comp/dashboard invalid P3
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
NousResearch/hermes-agent#121143 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
avniproject/avni-webapp#1811 ·
-
area/auroraboot area/webui bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100