Skip to content

Commit 1654562

Browse files
committed
really check if collation config is empty
1 parent 69fcc11 commit 1654562

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/function/aggregate/distributive/minmax.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ unique_ptr<FunctionData> BindMinMax(ClientContext &context, AggregateFunction &f
336336
auto str_collation = StringType::GetCollation(arguments[0]->return_type);
337337
Value collation_val;
338338
context.TryGetCurrentSetting("default_collation", collation_val);
339-
if (!str_collation.empty() || !collation_val.IsNull()) {
339+
string collation = collation_val.ToString();
340+
if (!str_collation.empty() || !collation.empty()) {
340341
// If aggr function is min/max and uses collations, replace bound_function with arg_min/arg_max
341342
// to make sure the result's correctness.
342343
string function_name = function.name == "min" ? "arg_min" : "arg_max";

src/planner/collation_binding.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ bool PushVarcharCollation(ClientContext &context, unique_ptr<Expression> &source
2020
if (collation.empty()) {
2121
Value collation_val;
2222
context.TryGetCurrentSetting("default_collation", collation_val);
23-
collation = collation_val.IsNull() ? string() : collation_val.ToString();
23+
collation = collation_val.ToString();
2424
}
2525
collation = StringUtil::Lower(collation);
2626
// bind the collation

0 commit comments

Comments
 (0)