diff options
author | Alexander Barkov <bar@mariadb.org> | 2016-05-10 19:13:06 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2016-05-10 19:13:06 +0400 |
commit | 964c4f070a7e96bf45979d8755beb10aa6e6617b (patch) | |
tree | 415424175ada49bdc0bacca8a5d466f601f61e08 /sql | |
parent | 672bbcd7411b20e87eca7845aceed81f361d6424 (diff) | |
download | mariadb-git-964c4f070a7e96bf45979d8755beb10aa6e6617b.tar.gz |
MDEV-10052 Illegal mix of collations with DAYNAME(date_field)<>varchar_field
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_timefunc.cc | 6 | ||||
-rw-r--r-- | sql/sql_locale.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 873dcdac4b9..28e93683422 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -935,9 +935,8 @@ void Item_func_monthname::fix_length_and_dec() { THD* thd= current_thd; CHARSET_INFO *cs= thd->variables.collation_connection; - uint32 repertoire= my_charset_repertoire(cs); locale= thd->variables.lc_time_names; - collation.set(cs, DERIVATION_COERCIBLE, repertoire); + collation.set(cs, DERIVATION_COERCIBLE, locale->repertoire()); decimals=0; max_length= locale->max_month_name_length * collation.collation->mbmaxlen; maybe_null=1; @@ -1082,9 +1081,8 @@ void Item_func_dayname::fix_length_and_dec() { THD* thd= current_thd; CHARSET_INFO *cs= thd->variables.collation_connection; - uint32 repertoire= my_charset_repertoire(cs); locale= thd->variables.lc_time_names; - collation.set(cs, DERIVATION_COERCIBLE, repertoire); + collation.set(cs, DERIVATION_COERCIBLE, locale->repertoire()); decimals=0; max_length= locale->max_day_name_length * collation.collation->mbmaxlen; maybe_null=1; diff --git a/sql/sql_locale.h b/sql/sql_locale.h index 8357a9ecba4..8559bb55cd9 100644 --- a/sql/sql_locale.h +++ b/sql/sql_locale.h @@ -61,6 +61,8 @@ public: grouping(grouping_par), errmsgs(errmsgs_par) {} + uint repertoire() const + { return is_ascii ? MY_REPERTOIRE_ASCII : MY_REPERTOIRE_EXTENDED; } }; /* Exported variables */ |