提交 c60fd424 编写于 作者: V Vyacheslav Alipov

added COLLATE to formatAST [#CONV-7651]

上级 29c3420b
......@@ -4,14 +4,18 @@
#include <DB/Core/ErrorCodes.h>
#include <DB/Core/Exception.h>
#include <Yandex/Common.h>
#include <Poco/String.h>
#include <Poco/NumberFormatter.h>
class Collator
#include <boost/noncopyable.hpp>
class Collator : private boost::noncopyable
{
public:
Collator(const std::string & locale_) : locale(Poco::toLower(locale_))
explicit Collator(const std::string & locale_) : locale(Poco::toLower(locale_))
{
UErrorCode status = U_ZERO_ERROR;
......
......@@ -439,6 +439,11 @@ void formatAST(const ASTOrderByElement & ast, std::ostream & s, size_t indent,
{
formatAST(*ast.children.front(), s, indent, hilite, one_line);
s << (hilite ? hilite_keyword : "") << (ast.direction == -1 ? " DESC" : " ASC") << (hilite ? hilite_none : "");
if (!ast.collator.isNull())
{
s << (hilite ? hilite_keyword : "") << " COLLATE " << (hilite ? hilite_none : "")
<< "'" << ast.collator->getLocale() << "'";
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册