-
Notifications
You must be signed in to change notification settings - Fork 750
Labels
indexespanicsqlrightbugs found using SQLRight (https://github.com/PSU-Security-Universe/sqlright)Ïbugs found using SQLRight (https://github.com/PSU-Security-Universe/sqlright)Ï
Description
Description
An expression index combined with a correlated EXISTS subquery causes the planner to fail resolving column references through the expression index.
Reproducer
CREATE TABLE t(b, c);
CREATE UNIQUE INDEX idx ON t(c, c + b);
SELECT c + b FROM t WHERE EXISTS (SELECT 1 FROM t AS t2 WHERE t.b = t2.b);
-- Turso: PANIC
-- SQLite: (works correctly)Panic Message
thread 'main' panicked at core/translate/expr.rs:2642:41:
index idx does not contain column number 0 of table t1
core/translate/expr.rs:2642 - The planner tries to resolve column references through the expression index but fails when a correlated subquery references columns not directly in the index.
This issue brought to you by Mikaël and Claude Code.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
indexespanicsqlrightbugs found using SQLRight (https://github.com/PSU-Security-Universe/sqlright)Ïbugs found using SQLRight (https://github.com/PSU-Security-Universe/sqlright)Ï