Commit ce069b1f authored by Alexander Barkov's avatar Alexander Barkov

A follow-up for WL#5624: Collation customization improvements

The reasons for failures to initialize a user collation defined
in Index.xml are now correctly reported                                  
(in SHOW WARNINGS and in the server error log) if the COLLATE clause
is used with an expression, e.g.:

  SELECT <exrp> COLLATE <collation name> FROM t1;

Previously, the failure reasons were reported only by COLLATE clauses
in SET NAMES and in DDL statements, e.g.:

  SET NAMES utf8 COLLATE utf8_xxx_ci;
  CREATE TABLE t1 (a VARCHAR(1) CHARACTER SET utf8 COLLATE utf8_xxx_ci);
parent a9240dce
......@@ -249,6 +249,10 @@ DROP TABLE t1;
SET NAMES utf8 COLLATE utf8_5624_2;
SHOW WARNINGS;
--error ER_UNKNOWN_COLLATION
SELECT _utf8'test' COLLATE utf8_5624_2;
SHOW WARNINGS;
--echo #
--echo # WL#5624, reset before primary ignorable
--echo #
......@@ -353,7 +357,7 @@ DROP TABLE t1;
--let $out_file= $MYSQLTEST_VARDIR/tmp/ctype_ldml_log.err
--let OUTF= $out_file
# Error messages are not seen in error log in embedded version
--let EMBEDDED=`SELECT version() LIKE '%embedded%'`
--let EMBEDDED=`SELECT IF(version() LIKE '%embedded%',2,0)`
--echo # Search for occurrences of [ERROR] Syntax error at '[strength tertiary]'
perl;
......
......@@ -3463,11 +3463,8 @@ void Item_func_set_collation::fix_length_and_dec()
MY_CS_BINSORT,MYF(0));
else
{
if (!(set_collation= get_charset_by_name(colname,MYF(0))))
{
my_error(ER_UNKNOWN_COLLATION, MYF(0), colname);
if (!(set_collation= mysqld_collation_get_by_name(colname)))
return;
}
}
if (!set_collation ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment