3229 Magne Mahre 2011-01-10
Bug#51631 general-log flag doesn't accept "on" as a value in
the my.cnf, works as command
Different parsing mechanisms are used for command line/my.cnf
options and the SQL commands. The former only accepted
numeric arguments, and regarded all numbers different from 0
as 'true'. Any other argument was parsed as 'false' .
This patch adds the words 'true' and 'on' as valid truth
values for boolean option arguments.
A test case is not provided, as the fix is simple and
does not warrant a separate test file (no existing
suitable test file was found)
(backported from mysql-trunk)
modified:
mysys/my_getopt.c
3228 Jon Olav Hauglid 2011-01-10
Bug #58933 Assertion `thd- >is_error()' fails on shutdown with ongoing
OPTIMIZE TABLE
OPTIMIZE TABLE for InnoDB tables is handled as recreate + analyze.
The triggered assert checked that an error had been reported if either
recreate or analyze failed. However the assert failed to take into
account that they could have failed because OPTIMIZE TABLE had been
victim of KILL QUERY, KILL CONNECTION or server shutdown.
This patch adjusts the assert to take this possibility into account.
The problem was only noticeable on debug versions of the server.
Test case added to innodb_mysql_sync.test.
modified:
mysql-test/r/innodb_mysql_sync.result
mysql-test/t/innodb_mysql_sync.test
sql/sql_admin.cc
=== modified file 'mysys/my_getopt.c'
--- a/mysys/my_getopt.c 2010-10-25 12:30:07 +0000
+++ b/mysys/my_getopt.c 2011-01-10 14:18:20 +0000
@@ -602,6 +602,24 @@ static char *check_struct_option(char *c
}
}
+/**
+ Parse a boolean command line argument
+
+ "ON", "TRUE" and "1" will return true,
+ other values will return false.
+
+ @param[in] argument The value argument
+ @return boolean value
+*/
+static my_bool get_bool_argument(const char *argument)
+{
+ if (!my_strcasecmp(&my_charset_latin1, argument, "true") ||
+ !my_strcasecmp(&my_charset_latin1, argument, "on"))
+ return 1;
+ else
+ return (my_bool) atoi(argument);
+}
+
/*
function: setval
@@ -629,7 +647,7 @@ static int setval(const struct my_option
switch ((opts->var_type & GET_TYPE_MASK)) {
case GET_BOOL: /* If argument differs from 0, enable option, else disable */
- *((my_bool*) value)= (my_bool) atoi(argument) != 0;
+ *((my_bool*) value)= get_bool_argument(argument);
break;
case GET_INT:
*((int*) value)= (int) getopt_ll(argument, opts, &err);
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.5 branch (magne.mahre:3228 to 3229) Bug#51631 | Magne Mahre | 10 Jan |