Skip to content

Commit

Permalink
fix sqllogictest
Browse files Browse the repository at this point in the history
Signed-off-by: Runji Wang <[email protected]>
  • Loading branch information
wangrunji0408 committed Mar 21, 2024
1 parent 6e6f511 commit 9e3a647
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/binder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,11 @@ impl Binder {
/// Add a CTE to the current context.
fn add_cte(&mut self, table_name: &str, query: Id, columns: HashMap<String, Id>) -> Result<()> {
let context = self.contexts.last_mut().unwrap();
if context.ctes.insert(table_name.into(), (query, columns)).is_some() {
if context
.ctes
.insert(table_name.into(), (query, columns))
.is_some()
{
return Err(BindError::DuplicatedCteName(table_name.into()));
}
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion src/binder/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ impl Binder {
}
let aggs = self.egraph.add(Node::List(aggs.into()));
*projection = self.egraph.add(Node::List(projs.into()));
Ok(self.egraph.add(Node::HashAgg([aggs, distinct, plan])))
Ok(self.egraph.add(Node::HashAgg([distinct, aggs, plan])))
}

/// Extracts all over nodes from `projection`, `distinct` and `orderby`.
Expand Down
2 changes: 1 addition & 1 deletion tests/sql/join_left_inner.slt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ create table b(v3 int, v4 int);
statement ok
insert into a values (1, 1), (2, 2), (3, 3);

query IIII
query IIII rowsort
select v1, v2, v3, v4 from a left join b on v1 = v3;
----
1 1 NULL NULL
Expand Down

0 comments on commit 9e3a647

Please sign in to comment.