Skip to content

Commit

Permalink
H-3612: Properly detect tables with different inheritance depths (#5770)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimDiekmann authored Dec 2, 2024
1 parent d7d5699 commit ebd1c2a
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use alloc::borrow::Cow;
use core::iter::once;
use core::{iter::once, mem};
use std::collections::{HashMap, HashSet};

use hash_graph_store::{
Expand Down Expand Up @@ -1018,6 +1018,16 @@ impl<'p, 'q: 'p, R: PostgresRecord> SelectCompiler<'p, 'q, R> {
// column. We need to create a new join statement later on with a new,
// unique alias.
join_expression.table.alias.number += 1;
} else if let (Table::Reference(lhs), Table::Reference(rhs)) =
(&existing.table.table, &join_expression.table.table)
{
if mem::discriminant(lhs) == mem::discriminant(rhs)
&& existing.table.alias == join_expression.table.alias
{
// We have a join statement for the same table but with different
// conditions.
join_expression.table.alias.number += 1;
}
}
}

Expand Down

0 comments on commit ebd1c2a

Please sign in to comment.