diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-11-09 09:11:50 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-11-09 09:11:50 +0200 |
commit | 25ac047bafefa582ff082d1ad1783e5ff3865c20 (patch) | |
tree | 7ce818faf8d0cf7b9c84602626ed6b10ef84c314 /sql/item_strfunc.cc | |
parent | 96f853260669bb67ab7a336e67d29f7221377cd3 (diff) | |
parent | 9c18b9660302a76a6ff9bd505888048a13586a4c (diff) | |
download | mariadb-git-25ac047bafefa582ff082d1ad1783e5ff3865c20.tar.gz |
Merge 10.5 into 10.6
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 9399a566715..eb9c59d31f7 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2017, Oracle and/or its affiliates. - Copyright (c) 2009, 2020, MariaDB Corporation. + Copyright (c) 2009, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -3579,11 +3579,13 @@ String *Item_func_set_collation::val_str(String *str) bool Item_func_set_collation::fix_length_and_dec() { - if (!my_charset_same(args[0]->collation.collation, m_set_collation)) + if (agg_arg_charsets_for_string_result(collation, args, 1)) + return true; + if (!my_charset_same(collation.collation, m_set_collation)) { my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), m_set_collation->coll_name.str, - args[0]->collation.collation->cs_name.str); + collation.collation->cs_name.str); return TRUE; } collation.set(m_set_collation, DERIVATION_EXPLICIT, |