Fix bug in print kExprFunctionRef expression. (#53)

* Fix bug in print kExprFunctionRef expression.

* Support print "groupBy" member in printSelectStatementInfo function.
This commit is contained in:
Nan Xiao 2017-07-20 04:20:05 +08:00 committed by Pedro Flemming
parent fe35651bb5
commit 12e35dcd63
1 changed files with 9 additions and 1 deletions

View File

@ -100,7 +100,7 @@ namespace hsql {
break; break;
case kExprFunctionRef: case kExprFunctionRef:
inprint(expr->name, numIndent); inprint(expr->name, numIndent);
inprint(expr->expr->name, numIndent + 1); for (Expr* e : *expr->exprList) inprint(e->name, numIndent + 1);
break; break;
case kExprOperator: case kExprOperator:
printOperatorExpression(expr, numIndent); printOperatorExpression(expr, numIndent);
@ -128,6 +128,14 @@ namespace hsql {
printExpression(stmt->whereClause, numIndent + 2); printExpression(stmt->whereClause, numIndent + 2);
} }
if (stmt->groupBy != nullptr) {
inprint("GroupBy:", numIndent + 1);
for (Expr* expr : *stmt->groupBy->columns) printExpression(expr, numIndent + 2);
if (stmt->groupBy->having != nullptr) {
inprint("Having:", numIndent + 1);
printExpression(stmt->groupBy->having, numIndent + 2);
}
}
if (stmt->unionSelect != nullptr) { if (stmt->unionSelect != nullptr) {
inprint("Union:", numIndent + 1); inprint("Union:", numIndent + 1);