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:
jussisaurio
2024-12-14 17:11:32 +02:00
parent 961e57df94
commit a04cf611e0

View File

@@ -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]