Commit 56526769 authored by vasil's avatar vasil

branches/5.1:

Merge a change from MySQL:
(this has been reviewed by Calvin and Marko, and Calvin says Luis has
incorporated Marko's suggestions)

  ------------------------------------------------------------
  revno: 3092.5.1
  committer: Luis Soares <luis.soares@sun.com>
  branch nick: mysql-5.1-bugteam
  timestamp: Thu 2009-09-24 15:52:52 +0100
  message:
    BUG#42829: binlogging enabled for all schemas regardless of
    binlog-db-db / binlog-ignore-db
          
    InnoDB will return an error if statement based replication is used
    along with transaction isolation level READ-COMMITTED (or weaker),
    even if the statement in question is filtered out according to the
    binlog-do-db rules set. In this case, an error should not be printed.
          
    This patch addresses this issue by extending the existing check in
    external_lock to take into account the filter rules before deciding to
    print an error. Furthermore, it also changes decide_logging_format to
    take into consideration whether the statement is filtered out from 
    binlog before decision is made.
  added:
    mysql-test/suite/binlog/r/binlog_stm_do_db.result
    mysql-test/suite/binlog/t/binlog_stm_do_db-master.opt
    mysql-test/suite/binlog/t/binlog_stm_do_db.test
  modified:
    sql/sql_base.cc
    sql/sql_class.cc
    storage/innobase/handler/ha_innodb.cc
    storage/innobase/handler/ha_innodb.h
    storage/innodb_plugin/handler/ha_innodb.cc
    storage/innodb_plugin/handler/ha_innodb.h
parent 9ca18bed
......@@ -7125,8 +7125,9 @@ ha_innobase::external_lock(
{
ulong const binlog_format= thd_binlog_format(thd);
ulong const tx_isolation = thd_tx_isolation(current_thd);
if (tx_isolation <= ISO_READ_COMMITTED &&
binlog_format == BINLOG_FORMAT_STMT)
if (tx_isolation <= ISO_READ_COMMITTED
&& binlog_format == BINLOG_FORMAT_STMT
&& thd_binlog_filter_ok(thd))
{
char buf[256];
my_snprintf(buf, sizeof(buf),
......
......@@ -252,4 +252,11 @@ int thd_binlog_format(const MYSQL_THD thd);
@param all TRUE <=> rollback main transaction.
*/
void thd_mark_transaction_to_rollback(MYSQL_THD thd, bool all);
/**
Check if binary logging is filtered for thread's current db.
@param thd Thread handle
@retval 1 the query is not filtered, 0 otherwise.
*/
bool thd_binlog_filter_ok(const MYSQL_THD thd);
}
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