mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 22:22:00 +00:00
4f91833e67
Conflicts: dbms/src/Parsers/ASTIdentifier.cpp
42 lines
965 B
C++
42 lines
965 B
C++
#include <Parsers/ASTIdentifier.h>
|
|
#include <IO/WriteBufferFromOStream.h>
|
|
#include <IO/WriteHelpers.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
void ASTIdentifier::formatImplWithoutAlias(const FormatSettings & settings, FormatState &, FormatStateStacked) const
|
|
{
|
|
auto format_element = [&](const String & elem_name)
|
|
{
|
|
settings.ostr << (settings.hilite ? hilite_identifier : "");
|
|
settings.writeIdentifier(elem_name);
|
|
settings.ostr << (settings.hilite ? hilite_none : "");
|
|
};
|
|
|
|
/// A simple or compound identifier?
|
|
|
|
if (children.size() > 1)
|
|
{
|
|
for (size_t i = 0, size = children.size(); i < size; ++i)
|
|
{
|
|
if (i != 0)
|
|
settings.ostr << '.';
|
|
|
|
format_element(static_cast<const ASTIdentifier &>(*children[i].get()).name);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
format_element(name);
|
|
}
|
|
}
|
|
|
|
void ASTIdentifier::appendColumnNameImpl(WriteBuffer & ostr) const
|
|
{
|
|
writeString(name, ostr);
|
|
}
|
|
|
|
}
|