From e9291cf851c4cf51dc3300b4eff8102cd156ea35 Mon Sep 17 00:00:00 2001 From: Joris Nix Date: Tue, 13 Feb 2024 13:58:51 +0100 Subject: [PATCH] [IR] Fix dumping nested `QueryGraph`s. Nested queries in SQL require an alias but internally created nested queries, e.g. due to HAVING, do not have to. --- src/IR/QueryGraph.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/IR/QueryGraph.cpp b/src/IR/QueryGraph.cpp index 710ebea9..0827b88b 100644 --- a/src/IR/QueryGraph.cpp +++ b/src/IR/QueryGraph.cpp @@ -2076,12 +2076,12 @@ void QueryGraph::dump(std::ostream &out) const auto &srcs = j->sources(); for (auto it = srcs.begin(), end = srcs.end(); it != end; ++it) { if (it != srcs.begin()) out << ' '; - if (it->get().alias()) { + if (it->get().alias()) out << it->get().alias(); - } else { - auto bt = as(it->get()); - out << bt.name(); - } + else if (auto bt = cast(&it->get())) + out << bt->name(); + else + out << "(...)"; } out << "} " << j->condition(); }