dbms: tiny modification [#METR-10489].

This commit is contained in:
Alexey Milovidov 2014-03-18 21:23:30 +04:00
parent 2c4a89b7fe
commit 68dd884b1f

View File

@ -565,9 +565,7 @@ void formatAST(const ASTFunction & ast, std::ostream & s, size_t indent, bool
}
}
if (!written && ast.arguments->children.size() >= 1)
{
if (!written && 0 == strcmp(ast.name.c_str(), "array"))
if (!written && ast.arguments->children.size() >= 1 && 0 == strcmp(ast.name.c_str(), "array"))
{
s << (hilite ? hilite_operator : "") << '[' << (hilite ? hilite_none : "");
for (size_t i = 0; i < ast.arguments->children.size(); ++i)
@ -580,7 +578,7 @@ void formatAST(const ASTFunction & ast, std::ostream & s, size_t indent, bool
written = true;
}
if (!written && 0 == strcmp(ast.name.c_str(), "tuple") && ast.arguments->children.size() >= 2)
if (!written && ast.arguments->children.size() >= 2 && 0 == strcmp(ast.name.c_str(), "tuple"))
{
s << (hilite ? hilite_operator : "") << '(' << (hilite ? hilite_none : "");
for (size_t i = 0; i < ast.arguments->children.size(); ++i)
@ -593,7 +591,6 @@ void formatAST(const ASTFunction & ast, std::ostream & s, size_t indent, bool
written = true;
}
}
}
if (!written)
{