Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

sqlite virtual table silently returns empty rows for unavailable join parameters

Đang mở
#66,214 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@trivikr đang làm issue này rồi.

Từ ngày 22/9/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

sqlite
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

Ngôn ngữ chính
JavaScript
Star
122k
Fork
37.4k
Merge trung bình
4 ngày 2 giờ
Pull request đã merge (30 ngày)
277

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nodejs/node

Tất cả issue của nodejs/node

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.