mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-30 13:24:22 +01:00
fix bug with making an index search node in a self join where expr refers to other instance of same table
This commit is contained in:
@@ -549,6 +549,9 @@ impl Optimizable for ast::Expr {
|
||||
) -> Result<Option<usize>> {
|
||||
match self {
|
||||
ast::Expr::Column { table, column, .. } => {
|
||||
if *table != table_index {
|
||||
return Ok(None);
|
||||
}
|
||||
for (idx, index) in available_indexes.iter().enumerate() {
|
||||
if index.table_name == referenced_tables[*table].table.name {
|
||||
let column = referenced_tables[*table]
|
||||
|
||||
Reference in New Issue
Block a user