handle comparation on dates

This commit is contained in:
VaclavT 2021-08-14 20:01:34 +02:00
parent fb5098cf1d
commit 2f6159767d
1 changed files with 2 additions and 3 deletions

View File

@ -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<ValueNode> USql::eval_database_value_node(Table *table, Row &row
return std::make_unique<StringValueNode>(db_value->getStringValue());
if (col_def.type == ColumnType::bool_type)
return std::make_unique<BooleanValueNode>(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<StringValueNode>(db_value->getStringValue());
return std::make_unique<IntValueNode>(db_value->getIntValue());
throw Exception("unknown database value type");
}