From ddb6276fac135dac55d8f79bbadc962facd4c52a Mon Sep 17 00:00:00 2001 From: mrks Date: Tue, 23 Apr 2019 11:03:18 +0200 Subject: [PATCH] Fix print (#112) --- src/util/sqlhelper.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/util/sqlhelper.cpp b/src/util/sqlhelper.cpp index 0fd7091..8e4aec4 100755 --- a/src/util/sqlhelper.cpp +++ b/src/util/sqlhelper.cpp @@ -188,9 +188,12 @@ namespace hsql { else inprint("descending", numIndent + 2); } - if (stmt->limit != nullptr) { + if (stmt->limit != nullptr && stmt->limit->limit != nullptr) { inprint("Limit:", numIndent + 1); printExpression(stmt->limit->limit, numIndent + 2); + } + + if (stmt->limit != nullptr && stmt->limit->offset != nullptr) { inprint("Offset:", numIndent + 1); printExpression(stmt->limit->offset, numIndent + 2); } @@ -199,19 +202,19 @@ namespace hsql { void printImportStatementInfo(const ImportStatement* stmt, uintmax_t numIndent) { - inprint("ImportStatment", numIndent); + inprint("ImportStatement", numIndent); inprint(stmt->filePath, numIndent + 1); inprint(stmt->tableName, numIndent + 1); } void printCreateStatementInfo(const CreateStatement* stmt, uintmax_t numIndent) { - inprint("CreateStatment", numIndent); + inprint("CreateStatement", numIndent); inprint(stmt->tableName, numIndent + 1); - inprint(stmt->filePath, numIndent + 1); + if (stmt->filePath) inprint(stmt->filePath, numIndent + 1); } void printInsertStatementInfo(const InsertStatement* stmt, uintmax_t numIndent) { - inprint("InsertStatment", numIndent); + inprint("InsertStatement", numIndent); inprint(stmt->tableName, numIndent + 1); if (stmt->columns != nullptr) { inprint("Columns", numIndent + 1);