From 2f6159767de18b133fa8a50a93f15a13f77fdb79 Mon Sep 17 00:00:00 2001 From: VaclavT Date: Sat, 14 Aug 2021 20:01:34 +0200 Subject: [PATCH] handle comparation on dates --- usql.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usql.cpp b/usql.cpp index 73d5eaf..e8865b5 100644 --- a/usql.cpp +++ b/usql.cpp @@ -431,7 +431,7 @@ bool USql::eval_relational_operator(const RelationalOperatorNode &filter, Table bool bl = left_value->getBooleanValue(); bool br = right_value->getBooleanValue(); comparator = bl == br ? 0 : 1; - // TODO handle dates + // date values are essentially int values so handled above } else { throw Exception("Undefined combination of types"); } @@ -487,9 +487,8 @@ std::unique_ptr USql::eval_database_value_node(Table *table, Row &row return std::make_unique(db_value->getStringValue()); if (col_def.type == ColumnType::bool_type) return std::make_unique(db_value->getBoolValue()); - // Date has no it's own value node (it is passed around as string) if (col_def.type == ColumnType::date_type) - return std::make_unique(db_value->getStringValue()); + return std::make_unique(db_value->getIntValue()); throw Exception("unknown database value type"); }