Fix printing of EXISTS (SELECT) (#114)
* Fix printing of EXISTS (SELECT) * Update sqlhelper.cpp
This commit is contained in:
parent
ddb6276fac
commit
ab1e6b4192
|
@ -88,10 +88,17 @@ namespace hsql {
|
||||||
case kOpNot:
|
case kOpNot:
|
||||||
inprint("NOT", numIndent);
|
inprint("NOT", numIndent);
|
||||||
break;
|
break;
|
||||||
|
case kOpExists:
|
||||||
|
inprint("EXISTS", numIndent);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
inprintU(expr->opType, numIndent);
|
inprintU(expr->opType, numIndent);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (expr->select) {
|
||||||
|
printSelectStatementInfo(expr->select, numIndent + 1);
|
||||||
|
} else {
|
||||||
printExpression(expr->expr, numIndent + 1);
|
printExpression(expr->expr, numIndent + 1);
|
||||||
if (expr->expr2 != nullptr) {
|
if (expr->expr2 != nullptr) {
|
||||||
printExpression(expr->expr2, numIndent + 1);
|
printExpression(expr->expr2, numIndent + 1);
|
||||||
|
@ -99,8 +106,10 @@ namespace hsql {
|
||||||
for (Expr* e : *expr->exprList) printExpression(e, numIndent + 1);
|
for (Expr* e : *expr->exprList) printExpression(e, numIndent + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void printExpression(Expr* expr, uintmax_t numIndent) {
|
void printExpression(Expr* expr, uintmax_t numIndent) {
|
||||||
|
if (!expr) return;
|
||||||
switch (expr->type) {
|
switch (expr->type) {
|
||||||
case kExprStar:
|
case kExprStar:
|
||||||
inprint("*", numIndent);
|
inprint("*", numIndent);
|
||||||
|
|
Loading…
Reference in New Issue