Below is the list of changes that have just been committed into a local
5.1 repository of elkin. When elkin does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-01-12 20:00:30+02:00, aelkin@stripped +3 -0
Bug #16567 binlog_format option does not show when doing ./mysqd --help --verbose
Implementing this feature connected to wl#3368 mixed binlog_format default.
Supplied by my.cnf or explicitly in command line option gets be displayed.
When not supplied `(No default value)' is displayed, even though --log-bin might
be supplied. The option is different object from @@global.binlog_format variable.
The default `mixed' for the latter is dependant on presence of `--log-bin' option,
otherwise the value of the var is set to NULL (undefined):
var := opt | MIXED when binlog-in-use
var := NULL otherwise (no binlog, no format)
Comments on NDB and mixed format updated, also dependency the option on --log-bin
aka binlog-in-use is worded.
Making t/rpl_switch_stm_row_mixed.test to interprete DEFAULT for binlog_format
as MIXED.
todo/fixme: turning @@global.binlog_format to be read-only when it's set to NULL (no binlog).
todo/fixme: options dependacy (acyclic) graph, particularly to solve a task of
setting defaults values for the leaf nodes
only when parents' nodes are set.
mysql-test/r/rpl_switch_stm_row_mixed.result@stripped, 2007-01-12 20:00:26+02:00, aelkin@stripped +5 -6
changed
mysql-test/t/rpl_switch_stm_row_mixed.test@stripped, 2007-01-12 20:00:27+02:00, aelkin@stripped +5 -7
correcting interpretation of DEFAULT for binlog_format.
sql/mysqld.cc@stripped, 2007-01-12 20:00:27+02:00, aelkin@stripped +27 -17
introducing command line option parser's opt_binlog_format and its default.
necessary code for transfering text value from command line arg into the system variable
@@global.binlog_format.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: aelkin
# Host: dsl-hkibras-fe36f900-97.dhcp.inet.fi
# Root: /home/elkin/MySQL/TEAM/FIXES/5.1/bug16567_binlog_verbose_help_jeb
--- 1.600/sql/mysqld.cc 2007-01-12 20:00:41 +02:00
+++ 1.601/sql/mysqld.cc 2007-01-12 20:00:41 +02:00
@@ -444,9 +444,10 @@ my_bool sp_automatic_privileges= 1;
ulong opt_binlog_rows_event_max_size;
const char *binlog_format_names[]= {"STATEMENT", "ROW", "MIXED", NullS};
TYPELIB binlog_format_typelib=
- { array_elements(binlog_format_names)-1,"",
+ { array_elements(binlog_format_names) - 1, "",
binlog_format_names, NULL };
-
+ulong opt_binlog_format_id= (ulong) BINLOG_FORMAT_UNSPEC;
+const char *opt_binlog_format= binlog_format_names[opt_binlog_format_id];
#ifdef HAVE_INITGROUPS
static bool calling_initgroups= FALSE; /* Used in SIGSEGV handler. */
#endif
@@ -3148,17 +3149,24 @@ with --log-bin instead.");
"--log-slave-updates work.");
unireg_abort(1);
}
-
- if (!opt_bin_log && (global_system_variables.binlog_format != BINLOG_FORMAT_UNSPEC))
- {
- sql_print_error("You need to use --log-bin to make "
- "--binlog-format work.");
- unireg_abort(1);
- }
- if (global_system_variables.binlog_format == BINLOG_FORMAT_UNSPEC)
- {
+ if (!opt_bin_log)
+ if (opt_binlog_format_id != BINLOG_FORMAT_UNSPEC)
+ {
+ sql_print_error("You need to use --log-bin to make "
+ "--binlog-format work.");
+ unireg_abort(1);
+ }
+ else
+ {
+ global_system_variables.binlog_format= BINLOG_FORMAT_UNSPEC;
+ }
+ else
+ if (opt_binlog_format_id == BINLOG_FORMAT_UNSPEC)
global_system_variables.binlog_format= BINLOG_FORMAT_MIXED;
- }
+ else
+ {
+ DBUG_ASSERT(global_system_variables.binlog_format != BINLOG_FORMAT_UNSPEC);
+ }
/* Check that we have not let the format to unspecified at this point */
DBUG_ASSERT((uint)global_system_variables.binlog_format <=
@@ -4905,6 +4913,7 @@ struct my_option my_long_options[] =
(gptr*) &my_bind_addr_str, (gptr*) &my_bind_addr_str, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"binlog_format", OPT_BINLOG_FORMAT,
+ "Does not have any effect without '--log-bin'. "
"Tell the master the form of binary logging to use: either 'row' for "
"row-based binary logging, or 'statement' for statement-based binary "
"logging, or 'mixed'. 'mixed' is statement-based binary logging except "
@@ -4912,11 +4921,12 @@ struct my_option my_long_options[] =
"involve user-defined functions (i.e. UDFs) or the UUID() function; for "
"those, row-based binary logging is automatically used. "
#ifdef HAVE_NDB_BINLOG
- "If ndbcluster is enabled, the default is 'row'."
+ "If ndbcluster is enabled and binlog_format is `mixed', the format switches"
+ " to 'row' and back implicitly per each query accessing a NDB table."
#endif
- , 0, 0, 0, GET_STR, REQUIRED_ARG,
- BINLOG_FORMAT_MIXED
- , 0, 0, 0, 0, 0 },
+ ,(gptr*) &opt_binlog_format, (gptr*) &opt_binlog_format,
+ 0, GET_STR, REQUIRED_ARG, BINLOG_FORMAT_MIXED, BINLOG_FORMAT_STMT,
+ BINLOG_FORMAT_MIXED, 0, 0, 0},
{"binlog-do-db", OPT_BINLOG_DO_DB,
"Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -7267,7 +7277,7 @@ get_one_option(int optid, const struct m
binlog_format_names[BINLOG_FORMAT_MIXED]);
exit(1);
}
- global_system_variables.binlog_format= id-1;
+ global_system_variables.binlog_format= opt_binlog_format_id= id - 1;
break;
}
case (int)OPT_BINLOG_DO_DB:
--- 1.16/mysql-test/r/rpl_switch_stm_row_mixed.result 2007-01-12 20:00:41 +02:00
+++ 1.17/mysql-test/r/rpl_switch_stm_row_mixed.result 2007-01-12 20:00:41 +02:00
@@ -67,12 +67,11 @@ execute stmt1 using @string;
deallocate prepare stmt1;
insert into t1 values("for_10_");
insert into t1 select "yesterday_11_";
-set binlog_format=default;
+set binlog_format=statement;
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
STATEMENT STATEMENT
-set global binlog_format=default;
-ERROR 42000: Variable 'binlog_format' doesn't have a default value
+set global binlog_format=statement;
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
STATEMENT STATEMENT
@@ -87,11 +86,11 @@ execute stmt1 using @string;
deallocate prepare stmt1;
insert into t1 values("for_15_");
insert into t1 select "yesterday_16_";
-set binlog_format=mixed;
+set global binlog_format=default;
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
-STATEMENT MIXED
-set global binlog_format=mixed;
+MIXED STATEMENT
+set binlog_format=default;
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
MIXED MIXED
--- 1.13/mysql-test/t/rpl_switch_stm_row_mixed.test 2007-01-12 20:00:41 +02:00
+++ 1.14/mysql-test/t/rpl_switch_stm_row_mixed.test 2007-01-12 20:00:41 +02:00
@@ -63,12 +63,10 @@ deallocate prepare stmt1;
insert into t1 values("for_10_");
insert into t1 select "yesterday_11_";
-# test SET DEFAULT (=statement at this point of test)
-set binlog_format=default;
+# test statement (is not default after wl#3368)
+set binlog_format=statement;
select @@global.binlog_format, @@session.binlog_format;
-# due to cluster it's hard to set back to default
---error ER_NO_DEFAULT
-set global binlog_format=default;
+set global binlog_format=statement;
select @@global.binlog_format, @@session.binlog_format;
prepare stmt1 from 'insert into t1 select ?';
@@ -87,9 +85,9 @@ insert into t1 select "yesterday_16_";
# and now the mixed mode
-set binlog_format=mixed;
+set global binlog_format=default;
select @@global.binlog_format, @@session.binlog_format;
-set global binlog_format=mixed;
+set binlog_format=default;
select @@global.binlog_format, @@session.binlog_format;
prepare stmt1 from 'insert into t1 select concat(UUID(),?)';
| Thread |
|---|
| • bk commit into 5.1 tree (aelkin:1.2374) BUG#16567 | Andrei Elkin | 12 Jan |