Prevent an infinite loop of self-proxying TableAlias I saw once

This commit is contained in:
Gwendal Roué committed 2020-12-05 12:24:05 +01:00
1 parent 1e2d07a16f
commit 5464d64180
1 file changed
+8
@@ -289,6 +289,10 @@ public class TableAlias: Hashable {
}
func becomeProxy(of base: TableAlias) {
if self === base {
return
}
switch impl {
case let .undefined(userName):
if let userName = userName {
@@ -312,6 +316,10 @@ public class TableAlias: Hashable {
/// Returns nil if aliases can't be merged (conflict in tables, aliases...)
func merged(with other: TableAlias) -> TableAlias? {
if self === other {
return self
}
let root = self.root
let otherRoot = other.root
switch (root.impl, otherRoot.impl) {