Fix print (#112)

This commit is contained in:
mrks 2019-04-23 11:03:18 +02:00 committed by GitHub
parent e0e58d0876
commit ddb6276fac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -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);