some methods marked const
This commit is contained in:
14
usql.cpp
14
usql.cpp
@@ -130,7 +130,7 @@ std::unique_ptr<ValueNode> USql::eval_database_value_node(Table *table, Row &row
|
||||
return std::make_unique<NullValueNode>();
|
||||
|
||||
if (col_def.type == ColumnType::integer_type)
|
||||
return std::make_unique<IntValueNode>(db_value.getIntValue());
|
||||
return std::make_unique<IntValueNode>(db_value.getIntegerValue());
|
||||
if (col_def.type == ColumnType::float_type)
|
||||
return std::make_unique<DoubleValueNode>(db_value.getDoubleValue());
|
||||
if (col_def.type == ColumnType::varchar_type)
|
||||
@@ -138,7 +138,7 @@ std::unique_ptr<ValueNode> USql::eval_database_value_node(Table *table, Row &row
|
||||
if (col_def.type == ColumnType::bool_type)
|
||||
return std::make_unique<BooleanValueNode>(db_value.getBoolValue());
|
||||
if (col_def.type == ColumnType::date_type)
|
||||
return std::make_unique<IntValueNode>(db_value.getIntValue());
|
||||
return std::make_unique<IntValueNode>(db_value.getIntegerValue());
|
||||
|
||||
throw Exception("unknown database value type");
|
||||
}
|
||||
@@ -197,7 +197,7 @@ USql::eval_function_value_node(Table *table, Row &row, Node *node, ColDefNode *c
|
||||
std::unique_ptr<ValueNode> USql::count_function(ColValue *agg_func_value, const std::vector<std::unique_ptr<ValueNode>> &evaluatedPars) {
|
||||
long c = 1;
|
||||
if (!agg_func_value->isNull()) {
|
||||
c = agg_func_value->getIntValue() + 1;
|
||||
c = agg_func_value->getIntegerValue() + 1;
|
||||
}
|
||||
return std::make_unique<IntValueNode>(c);
|
||||
}
|
||||
@@ -359,10 +359,10 @@ USql::max_function(const std::vector<std::unique_ptr<ValueNode>> &evaluatedPars,
|
||||
if (agg_func_value->isNull()) {
|
||||
return std::make_unique<IntValueNode>(val);
|
||||
} else {
|
||||
return std::make_unique<IntValueNode>(std::max(val, agg_func_value->getIntValue()));
|
||||
return std::make_unique<IntValueNode>(std::max(val, agg_func_value->getIntegerValue()));
|
||||
}
|
||||
} else {
|
||||
return std::make_unique<IntValueNode>(agg_func_value->getIntValue());
|
||||
return std::make_unique<IntValueNode>(agg_func_value->getIntegerValue());
|
||||
}
|
||||
} else if (col_def_node->type == ColumnType::float_type) {
|
||||
if (!evaluatedPars[0]->isNull()) {
|
||||
@@ -390,10 +390,10 @@ USql::min_function(const std::vector<std::unique_ptr<ValueNode>> &evaluatedPars,
|
||||
if (agg_func_value->isNull()) {
|
||||
return std::make_unique<IntValueNode>(val);
|
||||
} else {
|
||||
return std::make_unique<IntValueNode>(std::min(val, agg_func_value->getIntValue()));
|
||||
return std::make_unique<IntValueNode>(std::min(val, agg_func_value->getIntegerValue()));
|
||||
}
|
||||
} else {
|
||||
return std::make_unique<IntValueNode>(agg_func_value->getIntValue());
|
||||
return std::make_unique<IntValueNode>(agg_func_value->getIntegerValue());
|
||||
}
|
||||
} else if (col_def_node->type == ColumnType::float_type) {
|
||||
if (!evaluatedPars[0]->isNull()) {
|
||||
|
||||
Reference in New Issue
Block a user