Below is the list of changes that have just been committed into a local
5.0 repository of guilhem. When guilhem 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
1.2001 05/09/30 18:00:28 guilhem@stripped +18 -0
WL#1012:
0) fix for BUG#12627 "Insert statements inside functions are not replicated (RBR &
SBR)" by changing things
in replication of routines: simply put, the clever binlogging of functions (either using
DO() or relying
on the calling statement be an update), is conceptually wrong when row-based (in
row-based
just let ha_*_row() do the job, or let Query_log_event do the job for substatements
which are
binlogged statement-based (DDLs)), so I disable it in row-based.
1) fix for BUG#13325 "rpl_row_sp000.test causes slave to core (mysql_unlock_tables
(thd=0x924dd48))"
2) binlog_row_based is now defined (to a const, with a value of FALSE) even if RBR is
not compiled in, this removes
a lot of #ifdef HAVE_ROW_BASED_REPLICATION at no CPU cost.
3) If RBR, set trust_routine_creators to 1 automatically (no danger).
4) fixes of space and compiler warning.
wl1012-review-pending-comments.txt
1.11 05/09/30 18:00:16 guilhem@stripped +4 -0
more TODO
sql/sql_update.cc
1.171 05/09/30 18:00:16 guilhem@stripped +0 -8
now binlog_row_based always exists
sql/sql_table.cc
1.272 05/09/30 18:00:16 guilhem@stripped +2 -10
now binlog_row_based always exists
sql/sql_parse.cc
1.467 05/09/30 18:00:16 guilhem@stripped +5 -38
now binlog_row_based always exists
sql/sql_load.cc
1.87 05/09/30 18:00:16 guilhem@stripped +0 -12
now binlog_row_based always exists
sql/sql_insert.cc
1.176 05/09/30 18:00:16 guilhem@stripped +2 -17
now binlog_row_based always exists
sql/sql_delete.cc
1.163 05/09/30 18:00:16 guilhem@stripped +2 -9
now binlog_row_based always exists
sql/sql_class.cc
1.211 05/09/30 18:00:16 guilhem@stripped +2 -1
In "INSERT INTO t VALUES(func())", we don't need to disable binlogging when we execute
func(),
if this is RBR.
sql/sql_base.cc
1.308 05/09/30 18:00:16 guilhem@stripped +2 -5
now binlog_row_based always exists
sql/sql_acl.cc
1.169 05/09/30 18:00:16 guilhem@stripped +1 -5
now binlog_row_based always exists
sql/sp_head.cc
1.190 05/09/30 18:00:16 guilhem@stripped +37 -32
In RBR we don't need to binlog the function's call (using "DO func()") (fix for
BUG#12627), don't need to issue
a warning if function failed in the middle (no problem). Code shuffling.
sql/sp.cc
1.92 05/09/30 18:00:16 guilhem@stripped +0 -4
now binlog_row_based always exists
sql/mysqld.cc
1.484 05/09/30 18:00:16 guilhem@stripped +12 -6
now binlog_row_based always exists.
If RBR, set trust_routine_creators to 1 automatically (no danger).
Fix for a gcc warning.
sql/mysql_priv.h
1.345 05/09/30 18:00:15 guilhem@stripped +3 -1
now binlog_row_based always exists
sql/log_event.h
1.127 05/09/30 18:00:15 guilhem@stripped +5 -1
now binlog_row_based always exists
sql/log_event.cc
1.211 05/09/30 18:00:15 guilhem@stripped +34 -25
Unlock table at the end of Rows_log_event::exec_event, only if there is a table (fix
for BUG#13325)
sql/log.cc
1.177 05/09/30 18:00:15 guilhem@stripped +5 -9
now binlog_row_based always exists
sql/item_func.cc
1.257 05/09/30 18:00:15 guilhem@stripped +1 -1
warning "failed routine breaks binlog" not needed in RBR
# 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: guilhem
# Host: gbichot3.local
# Root: /home/mysql_src/mysql-5.0-wl1012
--- 1.256/sql/item_func.cc 2005-09-21 14:36:53 +02:00
+++ 1.257/sql/item_func.cc 2005-09-30 18:00:15 +02:00
@@ -4725,7 +4725,7 @@
res= m_sp->execute_function(thd, args, arg_count, itp);
thd->restore_sub_statement_state(&statement_state);
- if (res && mysql_bin_log.is_open() &&
+ if (res && !binlog_row_based && mysql_bin_log.is_open() &&
(m_sp->m_chistics->daccess == SP_CONTAINS_SQL ||
m_sp->m_chistics->daccess == SP_MODIFIES_SQL_DATA))
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
--- 1.176/sql/log.cc 2005-09-27 22:13:20 +02:00
+++ 1.177/sql/log.cc 2005-09-30 18:00:15 +02:00
@@ -1681,15 +1681,11 @@
of the SQL command
*/
- if (thd
-#ifdef HAVE_ROW_BASED_REPLICATION
- /*
- If row-based binlogging, Insert_id, Rand and other kind of "setting
- context" events are not needed.
- */
- && !binlog_row_based
-#endif
- )
+ /*
+ If row-based binlogging, Insert_id, Rand and other kind of "setting
+ context" events are not needed.
+ */
+ if (thd && !binlog_row_based)
{
if (thd->last_insert_id_used)
{
--- 1.210/sql/log_event.cc 2005-09-29 09:49:11 +02:00
+++ 1.211/sql/log_event.cc 2005-09-30 18:00:15 +02:00
@@ -5253,6 +5253,12 @@
OBSERVER. This will clear *all* mappings, not only those that
are open for the table. There is not good handle for on-close
actions for tables.
+
+ NOTE. Even if we have no table ('table' == 0) we still need to be
+ here, so that we increase the group relay log position. If we didn't, we
+ could have a group relay log position which lags behind "forever"
+ (assume the last master's transaction is ignored by the slave because of
+ replicate-ignore rules).
*/
rli->m_table_map.clear_tables();
@@ -5297,34 +5303,37 @@
DBUG_RETURN(error);
}
- /*
- If "table" is not NULL, we did a successful lock_tables(), without any
- prior LOCK TABLES and are not in prelocked mode, so this assertion should
- be true.
- */
- DBUG_ASSERT(!table || thd->lock);
- /*
- If we are here, there are more events to come which may use our mappings
- and our table. So don't clear mappings or close tables, just unlock
- tables.
- Why don't we lock the table once for all in
- Table_map_log_event::exec_event() ? Because we could have in binlog:
- BEGIN;
- Table_map t1 -> 1
- Write_rows to id 1
- Table_map t2 -> 2
- Write_rows to id 2
- Xid_log_event
- So we cannot lock t1 when executing the first Table_map, because at that
- moment we don't know we'll also have to lock t2, and all tables must be
- locked at once in MySQL.
- */
- mysql_unlock_tables(thd, thd->lock);
- thd->lock= 0;
+ if (table)
+ {
+ /*
+ As "table" is not NULL, we did a successful lock_tables(), without any
+ prior LOCK TABLES and are not in prelocked mode, so this assertion should
+ be true.
+ */
+ DBUG_ASSERT(thd->lock);
+ /*
+ If we are here, there are more events to come which may use our mappings
+ and our table. So don't clear mappings or close tables, just unlock
+ tables.
+ Why don't we lock the table once for all in
+ Table_map_log_event::exec_event() ? Because we could have in binlog:
+ BEGIN;
+ Table_map t1 -> 1
+ Write_rows to id 1
+ Table_map t2 -> 2
+ Write_rows to id 2
+ Xid_log_event
+ So we cannot lock t1 when executing the first Table_map, because at that
+ moment we don't know we'll also have to lock t2, and all tables must be
+ locked at once in MySQL.
+ */
+ mysql_unlock_tables(thd, thd->lock);
+ thd->lock= 0;
+ }
DBUG_ASSERT(error == 0);
rli->inc_event_relay_log_pos();
-
+
DBUG_RETURN(0);
}
#endif /* HAVE_REPLICATION */
--- 1.126/sql/log_event.h 2005-09-20 23:12:15 +02:00
+++ 1.127/sql/log_event.h 2005-09-30 18:00:15 +02:00
@@ -28,8 +28,12 @@
#include <my_bitmap.h>
-#if !defined(MYSQL_CLIENT) && defined(HAVE_ROW_BASED_REPLICATION)
+#if !defined(MYSQL_CLIENT)
+#ifdef HAVE_ROW_BASED_REPLICATION
extern my_bool binlog_row_based;
+#else
+extern const my_bool binlog_row_based;
+#endif
#endif
#define LOG_READ_EOF -1
--- 1.344/sql/mysql_priv.h 2005-09-27 22:13:20 +02:00
+++ 1.345/sql/mysql_priv.h 2005-09-30 18:00:15 +02:00
@@ -1147,7 +1147,9 @@
extern const char *opt_binlog_format;
#ifdef HAVE_ROW_BASED_REPLICATION
extern my_bool binlog_row_based;
-extern ulong opt_binlog_rows_event_max_size;
+extern ulong opt_binlog_rows_event_max_size;
+#else
+extern const my_bool binlog_row_based;
#endif
extern ulong rpl_recovery_rank, thread_cache_size;
extern ulong back_log;
--- 1.483/sql/mysqld.cc 2005-09-27 22:13:20 +02:00
+++ 1.484/sql/mysqld.cc 2005-09-30 18:00:16 +02:00
@@ -380,13 +380,12 @@
my_bool opt_noacl;
my_bool sp_automatic_privileges= 1;
+#ifdef HAVE_ROW_BASED_REPLICATION
/*
This variable below serves as an optimization for (opt_binlog_format ==
BF_ROW) as we need to do this test for every row. Stmt-based is default.
*/
my_bool binlog_row_based= FALSE;
-
-#ifdef HAVE_ROW_BASED_REPLICATION
ulong opt_binlog_rows_event_max_size;
const char *binlog_format_names[]= {"STATEMENT", "ROW", NullS};
/*
@@ -397,6 +396,7 @@
*/
enum binlog_format { BF_STMT= 0, BF_ROW= 1, BF_UNSPECIFIED= 2 };
#else
+const my_bool binlog_row_based= FALSE;
const char *binlog_format_names[]= {"STATEMENT", NullS};
enum binlog_format { BF_STMT= 0, BF_UNSPECIFIED= 2 };
#endif
@@ -2909,10 +2909,12 @@
#ifdef HAVE_INNOBASE_DB
innobase_locks_unsafe_for_binlog= TRUE;
#endif
+ /* Trust routine creators because they can do no harm */
+ trust_routine_creators= 1;
}
#endif
/* Check that we have not let the format to unspecified at this point */
- DBUG_ASSERT(opt_binlog_format_id <=
+ DBUG_ASSERT((uint)opt_binlog_format_id <=
array_elements(binlog_format_names)-1);
opt_binlog_format= binlog_format_names[opt_binlog_format_id];
@@ -4844,9 +4846,13 @@
*/
{"log-bin-trust-routine-creators", OPT_LOG_BIN_TRUST_ROUTINE_CREATORS,
"If equal to 0 (the default), then when --log-bin is used, creation of "
- "a routine is allowed only to users having the SUPER privilege and only"
- "if this routine may not break binary logging",
- (gptr*) &trust_routine_creators, (gptr*) &trust_routine_creators, 0,
+ "a routine is allowed only to users having the SUPER privilege (because of "
+ "security issues) and only if this routine may not break binary logging."
+#ifdef HAVE_ROW_BASED_REPLICATION
+ " If using --binlog-format=row, the security issues do not exist and the "
+ "binary logging cannot break so this option is automatically set to 1."
+#endif
+ ,(gptr*) &trust_routine_creators, (gptr*) &trust_routine_creators, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"log-error", OPT_ERROR_LOG_FILE, "Error log file.",
(gptr*) &log_error_file_ptr, (gptr*) &log_error_file_ptr, 0, GET_STR,
--- 1.168/sql/sql_acl.cc 2005-09-27 22:13:20 +02:00
+++ 1.169/sql/sql_acl.cc 2005-09-30 18:00:16 +02:00
@@ -1453,11 +1453,7 @@
acl_cache->clear(1); // Clear locked hostname cache
VOID(pthread_mutex_unlock(&acl_cache->lock));
result= 0;
-#ifdef HAVE_ROW_BASED_REPLICATION
- if (!binlog_row_based && mysql_bin_log.is_open())
-#else
- if (mysql_bin_log.is_open())
-#endif
+ if (!binlog_row_based && mysql_bin_log.is_open())
{
query_length=
my_sprintf(buff,
--- 1.307/sql/sql_base.cc 2005-09-27 22:13:20 +02:00
+++ 1.308/sql/sql_base.cc 2005-09-30 18:00:16 +02:00
@@ -636,11 +636,8 @@
next=table->next;
close_temporary(table, 1);
}
- if (query && found_user_tables && mysql_bin_log.is_open()
-#ifdef HAVE_ROW_BASED_REPLICATION
- && !binlog_row_based // CREATE TEMP TABLE not binlogged if row-based
-#endif
- )
+ if (query && found_user_tables && mysql_bin_log.is_open() &&
+ !binlog_row_based) // CREATE TEMP TABLE not binlogged if row-based
{
/* The -1 is to remove last ',' */
thd->clear_error();
--- 1.210/sql/sql_class.cc 2005-09-27 22:13:20 +02:00
+++ 1.211/sql/sql_class.cc 2005-09-30 18:00:16 +02:00
@@ -1948,7 +1948,8 @@
backup->cuted_fields= cuted_fields;
backup->client_capabilities= client_capabilities;
- if (!lex->requires_prelocking() || is_update_query(lex->sql_command))
+ if ((!lex->requires_prelocking() || is_update_query(lex->sql_command)) &&
+ !binlog_row_based)
options&= ~OPTION_BIN_LOG;
/* Disable result sets */
client_capabilities &= ~CLIENT_MULTI_RESULTS;
--- 1.162/sql/sql_delete.cc 2005-09-29 09:49:11 +02:00
+++ 1.163/sql/sql_delete.cc 2005-09-30 18:00:16 +02:00
@@ -263,11 +263,8 @@
/* See similar binlogging code in sql_update.cc, for comments */
if ((error < 0) || (deleted && !transactional_table))
{
- if (mysql_bin_log.is_open()
-#ifdef HAVE_ROW_BASED_REPLICATION
- && (!binlog_row_based || unlikely(ha_delete_row_bypassed))
-#endif
- )
+ if (mysql_bin_log.is_open() &&
+ (!binlog_row_based || unlikely(ha_delete_row_bypassed)))
{
if (error < 0)
thd->clear_error();
@@ -734,11 +731,7 @@
if ((local_error == 0) || (deleted && normal_tables))
{
-#ifdef HAVE_ROW_BASED_REPLICATION
if (!binlog_row_based && mysql_bin_log.is_open())
-#else
- if (mysql_bin_log.is_open())
-#endif
{
if (local_error == 0)
thd->clear_error();
--- 1.175/sql/sql_insert.cc 2005-09-27 22:13:21 +02:00
+++ 1.176/sql/sql_insert.cc 2005-09-30 18:00:16 +02:00
@@ -587,11 +587,7 @@
if ((info.copied || info.deleted || info.updated) &&
(error <= 0 || !transactional_table))
{
-#ifdef HAVE_ROW_BASED_REPLICATION
if (!binlog_row_based && mysql_bin_log.is_open())
-#else
- if (mysql_bin_log.is_open())
-#endif
{
if (error <= 0)
thd->clear_error();
@@ -1937,11 +1933,8 @@
{
int error;
ulong max_rows;
- bool using_ignore=0, using_bin_log= (mysql_bin_log.is_open()
-#ifdef HAVE_ROW_BASED_REPLICATION
- && !binlog_row_based
-#endif
- );
+ bool using_ignore=0,
+ using_bin_log= (mysql_bin_log.is_open() && !binlog_row_based);
delayed_row *row;
DBUG_ENTER("handle_inserts");
@@ -2410,11 +2403,7 @@
{
if (last_insert_id)
thd->insert_id(last_insert_id); // For binary log
-#ifdef HAVE_ROW_BASED_REPLICATION
if (!binlog_row_based && mysql_bin_log.is_open())
-#else
- if (mysql_bin_log.is_open())
-#endif
{
Query_log_event qinfo(thd, thd->query, thd->query_length,
table->file->has_transactions(), FALSE);
@@ -2455,11 +2444,7 @@
if (last_insert_id)
thd->insert_id(last_insert_id); // For binary log
/* Write to binlog before commiting transaction */
-#ifdef HAVE_ROW_BASED_REPLICATION
if (!binlog_row_based && mysql_bin_log.is_open())
-#else
- if (mysql_bin_log.is_open())
-#endif
{
if (!error)
thd->clear_error();
--- 1.86/sql/sql_load.cc 2005-09-27 22:13:21 +02:00
+++ 1.87/sql/sql_load.cc 2005-09-30 18:00:16 +02:00
@@ -401,11 +401,7 @@
;
#ifndef EMBEDDED_LIBRARY
-#ifdef HAVE_ROW_BASED_REPLICATION
if (!binlog_row_based && mysql_bin_log.is_open())
-#else
- if (mysql_bin_log.is_open())
-#endif
{
/*
Make sure last block (the one which caused the error) gets logged.
@@ -453,11 +449,7 @@
if (!transactional_table)
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
#ifndef EMBEDDED_LIBRARY
-#ifdef HAVE_ROW_BASED_REPLICATION
if (!binlog_row_based && mysql_bin_log.is_open())
-#else
- if (mysql_bin_log.is_open())
-#endif
{
/*
As already explained above, we need to call end_io_cache() or the last
@@ -904,11 +896,7 @@
if (get_it_from_net)
cache.read_function = _my_b_net_read;
-#ifdef HAVE_ROW_BASED_REPLICATION
if (!binlog_row_based && mysql_bin_log.is_open())
-#else
- if (mysql_bin_log.is_open())
-#endif
cache.pre_read = cache.pre_close =
(IO_CACHE_CALLBACK) log_loaded_block;
#endif
--- 1.466/sql/sql_parse.cc 2005-09-27 22:13:21 +02:00
+++ 1.467/sql/sql_parse.cc 2005-09-30 18:00:16 +02:00
@@ -3676,11 +3676,7 @@
break;
if (!(res= mysql_create_user(thd, lex->users_list)))
{
- if (mysql_bin_log.is_open()
-#ifdef HAVE_ROW_BASED_REPLICATION
- && !binlog_row_based
-#endif
- )
+ if (mysql_bin_log.is_open() && !binlog_row_based)
{
Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
mysql_bin_log.write(&qinfo);
@@ -3696,11 +3692,7 @@
break;
if (!(res= mysql_drop_user(thd, lex->users_list)))
{
- if (mysql_bin_log.is_open()
-#ifdef HAVE_ROW_BASED_REPLICATION
- && !binlog_row_based
-#endif
- )
+ if (mysql_bin_log.is_open() && !binlog_row_based)
{
Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
mysql_bin_log.write(&qinfo);
@@ -3716,11 +3708,7 @@
break;
if (!(res= mysql_rename_user(thd, lex->users_list)))
{
- if (mysql_bin_log.is_open()
-#ifdef HAVE_ROW_BASED_REPLICATION
- && !binlog_row_based
-#endif
- )
+ if (mysql_bin_log.is_open() && !binlog_row_based)
{
Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
mysql_bin_log.write(&qinfo);
@@ -3736,11 +3724,7 @@
break;
if (!(res = mysql_revoke_all(thd, lex->users_list)))
{
- if (mysql_bin_log.is_open()
-#ifdef HAVE_ROW_BASED_REPLICATION
- && !binlog_row_based
-#endif
- )
+ if (mysql_bin_log.is_open() && !binlog_row_based)
{
Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
mysql_bin_log.write(&qinfo);
@@ -3819,11 +3803,7 @@
lex->columns, lex->grant,
lex->sql_command == SQLCOM_REVOKE);
}
-#ifdef HAVE_ROW_BASED_REPLICATION
if (!binlog_row_based && !res && mysql_bin_log.is_open())
-#else
- if (!res && mysql_bin_log.is_open())
-#endif
{
thd->clear_error();
Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
@@ -3843,11 +3823,7 @@
lex->sql_command == SQLCOM_REVOKE);
if (!res)
{
-#ifdef HAVE_ROW_BASED_REPLICATION
if (!binlog_row_based && mysql_bin_log.is_open())
-#else
- if (mysql_bin_log.is_open())
-#endif
{
thd->clear_error();
Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
@@ -4280,7 +4256,6 @@
else
thd->clear_error();
}
-
/*
If warnings have been cleared, we have to clear total_warn_count
too, otherwise the clients get confused.
@@ -4359,11 +4334,7 @@
switch (result)
{
case SP_OK:
- if (mysql_bin_log.is_open()
-#ifdef HAVE_ROW_BASED_REPLICATION
- && !binlog_row_based
-#endif
- )
+ if (mysql_bin_log.is_open() && !binlog_row_based)
{
thd->clear_error();
Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
@@ -4450,11 +4421,7 @@
switch (result)
{
case SP_OK:
-#ifdef HAVE_ROW_BASED_REPLICATION
if (!binlog_row_based && mysql_bin_log.is_open())
-#else
- if (mysql_bin_log.is_open())
-#endif
{
thd->clear_error();
Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
--- 1.271/sql/sql_table.cc 2005-09-16 13:12:03 +02:00
+++ 1.272/sql/sql_table.cc 2005-09-30 18:00:16 +02:00
@@ -1637,10 +1637,8 @@
- The binary log is not open.
*/
if (!internal_tmp_table &&
-#ifdef HAVE_ROW_BASED_REPLICATION
- !(binlog_row_based &&
- (create_info->options & HA_LEX_CREATE_TMP_TABLE)) &&
-#endif
+ !(binlog_row_based &&
+ (create_info->options & HA_LEX_CREATE_TMP_TABLE)) &&
mysql_bin_log.is_open())
{
thd->clear_error();
@@ -3664,11 +3662,7 @@
goto err;
}
/* We don't replicate alter table statement on temporary tables */
-#ifdef HAVE_ROW_BASED_REPLICATION
if (!binlog_row_based && mysql_bin_log.is_open())
-#else
- if (mysql_bin_log.is_open())
-#endif
{
thd->clear_error();
Query_log_event qinfo(thd, thd->query, thd->query_length, FALSE, FALSE);
@@ -3806,10 +3800,8 @@
thd->proc_info="end";
if (mysql_bin_log.is_open())
{
-#ifdef HAVE_ROW_BASED_REPLICATION
DBUG_ASSERT(!(binlog_row_based &&
(create_info->options & HA_LEX_CREATE_TMP_TABLE)));
-#endif
thd->clear_error();
Query_log_event qinfo(thd, thd->query, thd->query_length, FALSE, FALSE);
mysql_bin_log.write(&qinfo);
--- 1.170/sql/sql_update.cc 2005-09-27 22:13:21 +02:00
+++ 1.171/sql/sql_update.cc 2005-09-30 18:00:16 +02:00
@@ -486,11 +486,7 @@
*/
if ((error < 0) || (updated && !transactional_table))
{
-#ifdef HAVE_ROW_BASED_REPLICATION
if (!binlog_row_based && mysql_bin_log.is_open())
-#else
- if (mysql_bin_log.is_open())
-#endif
{
if (error < 0)
thd->clear_error();
@@ -1457,11 +1453,7 @@
if ((local_error == 0) || (updated && !trans_safe))
{
-#ifdef HAVE_ROW_BASED_REPLICATION
if (!binlog_row_based && mysql_bin_log.is_open())
-#else
- if (mysql_bin_log.is_open())
-#endif
{
if (local_error == 0)
thd->clear_error();
--- 1.10/wl1012-review-pending-comments.txt 2005-09-29 09:49:11 +02:00
+++ 1.11/wl1012-review-pending-comments.txt 2005-09-30 18:00:16 +02:00
@@ -9820,6 +9820,10 @@
[G2TODO] has been suppressed before the final push (currently this is
[G2TODO] unfortunately the case in mysql-5.0-wl1012.
+[G2TODO] verify that a build without row-based compiles fine and
+[G2TODO] passes tests, before pushing into 5.0. Run a Valgrind
+[G2TODO] testsuite for this build and for a row-based build.
+
[G2TODO] Two "Commenting style issues" (which will be easier fixed
[G2TODO] if done before final big push) below.
--- 1.91/sql/sp.cc 2005-09-27 22:13:20 +02:00
+++ 1.92/sql/sp.cc 2005-09-30 18:00:16 +02:00
@@ -582,11 +582,7 @@
ret= SP_OK;
if (table->file->ha_write_row(table->record[0]))
ret= SP_WRITE_ROW_FAILED;
-#ifdef HAVE_ROW_BASED_REPLICATION
else if (!binlog_row_based && mysql_bin_log.is_open())
-#else
- else if (mysql_bin_log.is_open())
-#endif
{
thd->clear_error();
/* Such a statement can always go directly to binlog, no trans cache */
--- 1.189/sql/sp_head.cc 2005-09-27 22:13:20 +02:00
+++ 1.190/sql/sp_head.cc 2005-09-30 18:00:16 +02:00
@@ -1134,48 +1134,53 @@
thd->spcont= nctx;
- binlog_save_options= thd->options;
- need_binlog_call= mysql_bin_log.is_open() && (thd->options &
OPTION_BIN_LOG);
+ /*
+ If row-based binlogging, we don't need to binlog the function's call, let
+ each substatement be binlogged its way.
+ */
+ need_binlog_call= mysql_bin_log.is_open() &&
+ (thd->options & OPTION_BIN_LOG) && !binlog_row_based;
if (need_binlog_call)
{
reset_dynamic(&thd->user_var_events);
mysql_bin_log.start_union_events(thd);
+ binlog_save_options= thd->options;
+ thd->options&= ~OPTION_BIN_LOG;
}
-
- thd->options&= ~OPTION_BIN_LOG;
+
ret= execute(thd);
- thd->options= binlog_save_options;
-
- if (need_binlog_call)
- mysql_bin_log.stop_union_events(thd);
- if (need_binlog_call && thd->binlog_evt_union.unioned_events)
+ if (need_binlog_call)
{
- char buf[256];
- String bufstr(buf, sizeof(buf), &my_charset_bin);
- bufstr.length(0);
- bufstr.append("DO ", 3);
- append_identifier(thd, &bufstr, m_name.str, m_name.length);
- bufstr.append('(');
- for (uint i=0; i < argcount; i++)
- {
- if (i)
- bufstr.append(',');
- param_values[i]->print(&bufstr);
- }
- bufstr.append(')');
-
- /* TODO: check if needed in row-based */
- Query_log_event qinfo(thd, bufstr.ptr(), bufstr.length(),
- thd->binlog_evt_union.unioned_events_trans, FALSE);
- if (mysql_bin_log.write(&qinfo) &&
- thd->binlog_evt_union.unioned_events_trans)
+ mysql_bin_log.stop_union_events(thd);
+ thd->options= binlog_save_options;
+ if (thd->binlog_evt_union.unioned_events)
{
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR,
- "Invoked ROUTINE modified a transactional table but MySQL "
- "failed to reflect this change in the binary log");
+ char buf[256];
+ String bufstr(buf, sizeof(buf), &my_charset_bin);
+ bufstr.length(0);
+ bufstr.append("DO ", 3);
+ append_identifier(thd, &bufstr, m_name.str, m_name.length);
+ bufstr.append('(');
+ for (uint i=0; i < argcount; i++)
+ {
+ if (i)
+ bufstr.append(',');
+ param_values[i]->print(&bufstr);
+ }
+ bufstr.append(')');
+
+ Query_log_event qinfo(thd, bufstr.ptr(), bufstr.length(),
+ thd->binlog_evt_union.unioned_events_trans, FALSE);
+ if (mysql_bin_log.write(&qinfo) &&
+ thd->binlog_evt_union.unioned_events_trans)
+ {
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR,
+ "Invoked ROUTINE modified a transactional table but MySQL "
+ "failed to reflect this change in the binary log");
+ }
+ reset_dynamic(&thd->user_var_events);
}
- reset_dynamic(&thd->user_var_events);
}
if (m_type == TYPE_ENUM_FUNCTION && ret == 0)
| Thread |
|---|
| • bk commit into 5.0 tree (guilhem:1.2001) BUG#13325 | guilhem | 30 Sep |