mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-06 17:54:20 +01:00
fix optimizer tests
This commit is contained in:
@@ -501,7 +501,7 @@ fn generate_join_bitmasks(table_number_max_exclusive: usize, how_many: usize) ->
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
use std::{collections::VecDeque, sync::Arc};
|
||||
|
||||
use turso_parser::ast::{self, Expr, Operator, SortOrder, TableInternalId};
|
||||
|
||||
@@ -677,7 +677,7 @@ mod tests {
|
||||
root_page: 1,
|
||||
has_rowid: true,
|
||||
});
|
||||
available_indexes.insert("test_table".to_string(), vec![index]);
|
||||
available_indexes.insert("test_table".to_string(), VecDeque::from([index]));
|
||||
|
||||
let table_constraints =
|
||||
constraints_from_where_clause(&where_clause, &table_references, &available_indexes)
|
||||
@@ -747,7 +747,7 @@ mod tests {
|
||||
root_page: 1,
|
||||
has_rowid: true,
|
||||
});
|
||||
available_indexes.insert("table1".to_string(), vec![index1]);
|
||||
available_indexes.insert("table1".to_string(), VecDeque::from([index1]));
|
||||
|
||||
// SELECT * FROM table1 JOIN table2 WHERE table1.id = table2.id
|
||||
// expecting table2 to be chosen first due to the index on table1.id
|
||||
@@ -865,7 +865,7 @@ mod tests {
|
||||
root_page: 1,
|
||||
has_rowid: true,
|
||||
});
|
||||
available_indexes.insert(table_name.to_string(), vec![index]);
|
||||
available_indexes.insert(table_name.to_string(), VecDeque::from([index]));
|
||||
});
|
||||
let customer_id_idx = Arc::new(Index {
|
||||
name: "orders_customer_id_idx".to_string(),
|
||||
@@ -902,10 +902,10 @@ mod tests {
|
||||
|
||||
available_indexes
|
||||
.entry("orders".to_string())
|
||||
.and_modify(|v| v.push(customer_id_idx));
|
||||
.and_modify(|v| v.push_front(customer_id_idx));
|
||||
available_indexes
|
||||
.entry("order_items".to_string())
|
||||
.and_modify(|v| v.push(order_id_idx));
|
||||
.and_modify(|v| v.push_front(order_id_idx));
|
||||
|
||||
// SELECT * FROM orders JOIN customers JOIN order_items
|
||||
// WHERE orders.customer_id = customers.id AND orders.id = order_items.order_id AND customers.id = 42
|
||||
@@ -1324,7 +1324,7 @@ mod tests {
|
||||
});
|
||||
|
||||
let mut available_indexes = HashMap::new();
|
||||
available_indexes.insert("t1".to_string(), vec![index]);
|
||||
available_indexes.insert("t1".to_string(), VecDeque::from([index]));
|
||||
|
||||
let table = Table::BTree(table);
|
||||
joined_tables.push(JoinedTable {
|
||||
@@ -1416,7 +1416,7 @@ mod tests {
|
||||
ephemeral: false,
|
||||
has_rowid: true,
|
||||
});
|
||||
available_indexes.insert("t1".to_string(), vec![index]);
|
||||
available_indexes.insert("t1".to_string(), VecDeque::from([index]));
|
||||
|
||||
let table = Table::BTree(table);
|
||||
joined_tables.push(JoinedTable {
|
||||
@@ -1528,7 +1528,7 @@ mod tests {
|
||||
has_rowid: true,
|
||||
unique: false,
|
||||
});
|
||||
available_indexes.insert("t1".to_string(), vec![index]);
|
||||
available_indexes.insert("t1".to_string(), VecDeque::from([index]));
|
||||
|
||||
let table = Table::BTree(table);
|
||||
joined_tables.push(JoinedTable {
|
||||
|
||||
Reference in New Issue
Block a user