4031 Alexander Barkov 2012-06-20
Bug#14197426 parse errors in loadable UCA / LDML collations are silently ignored
Problem: character set and collation errors in a running mysqld
were erroneously sent to buffered_log, which is intended to
be used only at earlier mysqld initialization step and should not
be used after initialization.
Fix: send character set and collation errors in a initialized
server directly to error log instead of buffered_logs.
modified:
mysql-test/r/ctype_ldml.result
mysql-test/t/ctype_ldml-master.opt
mysql-test/t/ctype_ldml.test
sql/mysqld.cc
4030 Alexander Nozdrin 2012-06-20
Patch for WL#6301 (Change default value for the 'bind-address' option).
The patch consists of two parts:
- the patch introduces a new special value for the bind-address
option: * (a star). This value means, the server should listen to
all network addresses, both IPv6 (if available) and IPv4.
- the patch changes the bind-address default value to star (*).
modified:
mysql-test/r/mysqld--help-notwin.result
mysql-test/r/mysqld--help-win.result
mysql-test/t/ipv6-master.opt
mysql-test/t/ipv6.test
sql/mysqld.cc
sql/mysqld.h
sql/sys_vars.cc
=== modified file 'mysql-test/r/ctype_ldml.result'
--- a/mysql-test/r/ctype_ldml.result 2011-02-22 13:25:05 +0000
+++ b/mysql-test/r/ctype_ldml.result 2012-06-20 09:10:58 +0000
@@ -1133,3 +1133,8 @@ DROP TABLE t1;
#
# End of WL#5624
#
+#
+# Bug#14197426 PARSE ERRORS IN LOADABLE UCA / LDML COLLATIONS ARE SILENTLY IGNORED
+#
+# Search for occurrences of [ERROR] Syntax error at '[strength tertiary]'
+Occurances : 1
=== modified file 'mysql-test/t/ctype_ldml-master.opt'
--- a/mysql-test/t/ctype_ldml-master.opt 2007-06-07 12:55:55 +0000
+++ b/mysql-test/t/ctype_ldml-master.opt 2012-06-20 09:10:58 +0000
@@ -1,2 +1,3 @@
--character-sets-dir=$MYSQL_TEST_DIR/std_data/
-
+--log-error=$MYSQLTEST_VARDIR/tmp/ctype_ldml_log.err
+--force-restart
=== modified file 'mysql-test/t/ctype_ldml.test'
--- a/mysql-test/t/ctype_ldml.test 2011-02-22 13:25:05 +0000
+++ b/mysql-test/t/ctype_ldml.test 2012-06-20 09:10:58 +0000
@@ -368,3 +368,23 @@ DROP TABLE t1;
--echo #
--echo # End of WL#5624
--echo #
+
+
+--echo #
+--echo # Bug#14197426 PARSE ERRORS IN LOADABLE UCA / LDML COLLATIONS ARE SILENTLY IGNORED
+--echo #
+
+--let $out_file= $MYSQLTEST_VARDIR/tmp/ctype_ldml_log.err
+--let OUTF= $out_file
+
+--echo # Search for occurrences of [ERROR] Syntax error at '[strength tertiary]'
+
+perl;
+ use strict;
+ my $outf= $ENV{'OUTF'} or die "OUTF not set";
+ open(FILE, "$outf") or die("Unable to open $outf: $!\n");
+ my $count_error = grep(/\[ERROR\] Syntax error at '\[strength tertiary\]'/gi,<FILE>);
+
+ print "Occurances : $count_error\n";
+ close(FILE);
+EOF
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2012-06-20 09:14:59 +0000
+++ b/sql/mysqld.cc 2012-06-20 09:10:58 +0000
@@ -1085,6 +1085,32 @@ static void buffered_option_error_report
va_end(args);
buffered_logs.buffer(level, buffer);
}
+
+
+/**
+ Character set and collation error reporter that prints to sql error log.
+ @param level log message level
+ @param format log message format string
+
+ This routine is used to print character set and collation
+ warnings and errors inside an already running mysqld server,
+ e.g. when a character set or collation is requested for the very first time
+ and its initialization does not go well for some reasons.
+
+ Note: At early mysqld initialization stage,
+ when error log is not yet available,
+ we use buffered_option_error_reporter() instead,
+ to print general character set subsystem initialization errors,
+ such as Index.xml syntax problems, bad XML tag hierarchy, etc.
+*/
+static void charset_error_reporter(enum loglevel level,
+ const char *format, ...)
+{
+ va_list args;
+ va_start(args, format);
+ vprint_msg_to_log(level, format, args);
+ va_end(args);
+}
C_MODE_END
static MYSQL_SOCKET unix_sock, ip_sock;
@@ -4415,6 +4441,13 @@ static int init_server_components()
buffered_logs.cleanup();
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
+ /*
+ Now that the logger is available, redirect character set
+ errors directly to the logger
+ (instead of the buffered_logs used at the server startup time).
+ */
+ my_charset_error_reporter= charset_error_reporter;
+
if (xid_cache_init())
{
sql_print_error("Out of memory");
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (alexander.barkov:4030 to 4031) Bug#14197426 | Alexander Barkov | 20 Jun |