diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-13 18:57:00 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-13 18:57:00 +0300 |
commit | 624dd71b9419555eca8baadc695e3376de72286f (patch) | |
tree | 31aaab8aeac43f921638407ab82190dd05a72793 /sql/item_sum.cc | |
parent | d4d865fcc8083782b6e4419c69bec372cd0b4142 (diff) | |
parent | e9c1701e11e2441435223cc7c00c467f58aaff19 (diff) | |
download | mariadb-git-624dd71b9419555eca8baadc695e3376de72286f.tar.gz |
Merge 10.4 into 10.5
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 0fbb0fd5ec3..3e915363c12 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -3058,11 +3058,14 @@ Item_sum_hybrid::min_max_update_str_field() if (!args[0]->null_value) { - result_field->val_str(&cmp->value2); - - if (result_field->is_null() || - (cmp_sign * sortcmp(res_str,&cmp->value2,collation.collation)) < 0) + if (result_field->is_null()) result_field->store(res_str->ptr(),res_str->length(),res_str->charset()); + else + { + result_field->val_str(&cmp->value2); + if ((cmp_sign * sortcmp(res_str,&cmp->value2,collation.collation)) < 0) + result_field->store(res_str->ptr(),res_str->length(),res_str->charset()); + } result_field->set_notnull(); } DBUG_VOID_RETURN; |