mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-28 04:24:20 +00:00
Prevent an infinite loop of self-proxying TableAlias I saw once
This commit is contained in:
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) {
|
||||
|
||||
Reference in new issue
Block a user