tursodatabase/turso

BETWEEN Expression Evaluates Left Side Twice

Open

#5,152 opened on 2026年2月11日

GitHub で見る
 (6 comments) (0 reactions) (0 assignees)Rust (1,001 forks)github user discovery
good first issueperformancequery planner

Repository metrics

Stars
 (19,103 stars)
PR merge metrics
 (PR metrics pending)

説明

Description

BETWEEN expressions evaluate the left side twice per row.

Reproducer

CREATE TABLE t(id INTEGER PRIMARY KEY);
INSERT INTO t VALUES(1), (2), (3);

SELECT id FROM t WHERE (SELECT max(id) FROM t) BETWEEN 1 AND 3;
-- Subquery executed twice per row

core/translate/expr.rs:4025-4048 - BETWEEN expands to two comparisons, each calling translate_expr(left).


This issue brought to you by Mikaël and Claude Code.

コントリビューターガイド