Bug #50479 DDL stmt on row-only/stmt-only tables generate spurious binlog_format errors
Submitted: 20 Jan 2010 15:13 Modified: 4 Aug 2010 23:22
Reporter: Sven Sandberg Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:5.1-rep+3, 6.0-rpl-merge OS:Any
Assigned to: Alfranio Junior CPU Architecture:Any
Tags: binlog_format, error message, regression

[20 Jan 2010 15:13] Sven Sandberg
Description:
In the fix of BUG#39934 in 5.1-rep+3, errors are generated when binlog_format=row and a statement modifies a table restricted to statement-logging; or if binlog_format=statement and a statement modifies a table limited to row-logging. 

The check is in THD::decide_logging_format and is based on which tables are locked. However, that causes spurious errors for some DDL statements that lock tables but where the conflict between the engine's supported logging format and the value of binlog_format is harmless.

How to repeat:
The following test case shows all error cases I could find. Each error that it generates is wrong, it would be better if it didn't generate any error.

==== binlog_bug-master.opt ====
--innodb $EXAMPLE_PLUGIN_OPT

==== binlog_bug.test ====
# innodb is row-only when transation level is READ COMMITTED.
# example storage engine i stmt-only
--source include/have_innodb.inc
--source include/have_example_plugin.inc
--source include/have_log_bin.inc

INSTALL PLUGIN example SONAME 'ha_example.so';

SET binlog_format = STATEMENT;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
CREATE TABLE t_row (a VARCHAR(100)) ENGINE = InnoDB;

--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
ALTER TABLE t_row ADD COLUMN a INT;

--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
CREATE TRIGGER trig BEFORE INSERT ON t_row FOR EACH ROW INSERT INTO t_stmt VALUES (1);

--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
CREATE INDEX i ON t_row(a);

SET binlog_format = ROW;
CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE;

--error ER_BINLOG_ROW_MODE_AND_STMT_ENGINE
ALTER TABLE t_stmt ADD COLUMN a INT;

--error ER_BINLOG_ROW_MODE_AND_STMT_ENGINE
CREATE TRIGGER trig BEFORE INSERT ON t_stmt FOR EACH ROW INSERT INTO t_stmt VALUES (1);

--error ER_BINLOG_ROW_MODE_AND_STMT_ENGINE
CREATE INDEX i ON t_stmt(a);

Suggested fix:
In THD::decide_logging_format, consider only tables that may produce row events. To detect this condition, add a bit CF_CAN_GENERATE_ROW_EVENTS to sql_command_flags.

This could possibly allow a small code cleanup: we should investigate if this flag can replace the qtype parameter to binlog_query(). I think it may be possible to get rid of the qtype parameter and instead make binlog_query() check the CF_CAN_GENERATE_ROW_EVENTS flag of sql_command_flags.
[20 Jan 2010 15:18] Sven Sandberg
Note: Currently, ALTER TABLE and CREATE INDEX are affected in 5.1-rep+3 and 6.0-rpl-merge. CREATE TRIGGER is only affected in 6.0-rpl-merge. I didn't find any other DDL command that was affected.

CREATE TABLE ... SELECT can generate an error, which is good because the command can generate row events. CREATE TABLE without SELECT cannot generate an error, which is good too because the command cannot generate row events.
[21 Jan 2010 6:54] Sveta Smirnova
Thank you for the report.

Verified as described.
[13 Feb 2010 8:36] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100213083436-9pesg4h55w1mekxc) (version source revid:luis.soares@sun.com-20100211135109-t63avry9fqpgyh78) (merge vers: 6.0.14-alpha) (pib:16)
[1 Mar 2010 16:59] Sven Sandberg
No patch has been pushed for this bug. The auto-generated comment above is because a changeset refers to this bug, but it does not fix this bug (revid:sven.sandberg@sun.com-20100120163701-k19rxvnzxpog3coc).
[8 Mar 2010 19:10] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/102612

3182 Alfranio Correia	2010-03-08
      BUG#50479 DDL stmt on row-only/stmt-only tables generate spurious binlog_format errors
      
      In the fix of BUG#39934 in 5.1-rep+3, errors are generated when
      binlog_format=row and a statement modifies a table restricted to
      statement-logging (ER_BINLOG_ROW_MODE_AND_STMT_ENGINE); or if
      binlog_format=statement and a statement modifies a table limited to
      row-logging (ER_BINLOG_STMT_MODE_AND_ROW_ENGINE).
      
      However, some DDL statements that lock tables (e.g. ALTER TABLE,
      CREATE INDEX and CREATE TRIGGER) were causing spurious errors,
      although any row might be inserted into the binary log.
      
      To fix the problem, we tagged statements that may generate
      rows into the binary log and thence the warning messages are
      only printed out wen the appropriate conditions hold and rows
      might be changed.
     @ mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result
        Added test case.
     @ mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt
        Added test case.
     @ mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test
        Added test case.
[9 Mar 2010 21:58] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/102787

3182 Alfranio Correia	2010-03-09
      BUG#50479 DDL stmt on row-only/stmt-only tables generate spurious binlog_format errors
      
      In the fix of BUG#39934 in 5.1-rep+3, errors are generated when
      binlog_format=row and a statement modifies a table restricted to
      statement-logging (ER_BINLOG_ROW_MODE_AND_STMT_ENGINE); or if
      binlog_format=statement and a statement modifies a table limited to
      row-logging (ER_BINLOG_STMT_MODE_AND_ROW_ENGINE).
      
      However, some DDL statements that lock tables (e.g. ALTER TABLE,
      CREATE INDEX and CREATE TRIGGER) were causing spurious errors,
      although any row might be inserted into the binary log.
      
      To fix the problem, we tagged statements that may generate
      rows into the binary log and thence the warning messages are
      only printed out wen the appropriate conditions hold and rows
      might be changed.
     @ mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result
        Added test case.
     @ mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt
        Added test case.
     @ mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test
        Added test case.
     @ sql/log_event.cc
        Reorganized the Query_log_event's constructor based on the
        CF_CAN_GENERATE_ROW_EVENTS flag and as such any statement
        that has the associated flag should go through a cache
        before being written to the binary log.
     @ sql/sql_class.cc
        Created a hook to be used by innodb that checks if a statement
        may write rows to the binary log. In other words, if it has
        the CF_CAN_GENERATE_ROW_EVENTS flag associated.
     @ sql/sql_class.h
        Defined the CF_CAN_GENERATE_ROW_EVENTS flag.
     @ sql/sql_parse.cc
        Updated the sql_command_flags.
     @ storage/innobase/handler/ha_innodb.cc
        Added a call to the hook thd_generates_rows().
     @ storage/innobase/handler/ha_innodb.h
        Defined an external reference to the hook thd_generates_rows().
     @ storage/innodb_plugin/handler/ha_innodb.cc
        Added a call to the hook thd_generates_rows().
     @ storage/innodb_plugin/handler/ha_innodb.h
        Defined an external reference to the hook thd_generates_rows().
[24 Mar 2010 8:14] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100324081249-yfwol7qtcek6dh7w) (version source revid:alik@sun.com-20100324081113-kc7x1iytnplww91u) (merge vers: 6.0.14-alpha) (pib:16)
[24 Mar 2010 8:17] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100324081159-5b8juv8ldiqwce8v) (version source revid:alik@sun.com-20100324081105-y72rautcea375zxm) (pib:16)
[16 Apr 2010 12:20] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/105849

3182 Alfranio Correia	2010-04-16
      BUG#50479 DDL stmt on row-only/stmt-only tables generate spurious binlog_format errors
      
      In the fix of BUG#39934 in 5.1-rep+3, errors are generated when
      binlog_format=row and a statement modifies a table restricted to
      statement-logging (ER_BINLOG_ROW_MODE_AND_STMT_ENGINE); or if
      binlog_format=statement and a statement modifies a table restricted to
      row-logging (ER_BINLOG_STMT_MODE_AND_ROW_ENGINE).
      
      However, some DDL statements that lock tables (e.g. ALTER TABLE,
      CREATE INDEX and CREATE TRIGGER) were causing spurious errors,
      although no row might be inserted into the binary log.
      
      To fix the problem, we tagged statements that may generate
      rows into the binary log and thence the warning messages are
      only printed out when the appropriate conditions hold and rows
      might be changed.
     @ mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result
        Added test case.
     @ mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt
        Added test case.
     @ mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test
        Added test case.
     @ sql/log_event.cc
        Reorganized the Query_log_event's constructor based on the
        CF_CAN_GENERATE_ROW_EVENTS flag and as such any statement
        that has the associated flag should go through a cache
        before being written to the binary log.
     @ sql/sql_class.cc
        Created a hook to be used by innodb that checks if a statement
        may write rows to the binary log. In other words, if it has
        the CF_CAN_GENERATE_ROW_EVENTS flag associated.
     @ sql/sql_class.h
        Defined the CF_CAN_GENERATE_ROW_EVENTS flag.
     @ sql/sql_parse.cc
        Updated the sql_command_flags.
     @ storage/innobase/handler/ha_innodb.cc
        Added a call to the hook thd_generates_rows().
     @ storage/innobase/handler/ha_innodb.h
        Defined an external reference to the hook thd_generates_rows().
     @ storage/innodb_plugin/handler/ha_innodb.cc
        Added a call to the hook thd_generates_rows().
     @ storage/innodb_plugin/handler/ha_innodb.h
        Defined an external reference to the hook thd_generates_rows().
[16 Apr 2010 12:30] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/105855

3182 Alfranio Correia	2010-04-16
      BUG#50479 DDL stmt on row-only/stmt-only tables generate spurious binlog_format errors
      
      In the fix of BUG#39934 in 5.1-rep+3, errors are generated when
      binlog_format=row and a statement modifies a table restricted to
      statement-logging (ER_BINLOG_ROW_MODE_AND_STMT_ENGINE); or if
      binlog_format=statement and a statement modifies a table restricted to
      row-logging (ER_BINLOG_STMT_MODE_AND_ROW_ENGINE).
      
      However, some DDL statements that lock tables (e.g. ALTER TABLE,
      CREATE INDEX and CREATE TRIGGER) were causing spurious errors,
      although no row might be inserted into the binary log.
      
      To fix the problem, we tagged statements that may generate
      rows into the binary log and thence the warning messages are
      only printed out when the appropriate conditions hold and rows
      might be changed.
     @ mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result
        Added test case.
     @ mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt
        Added test case.
     @ mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test
        Added test case.
     @ sql/log_event.cc
        Reorganized the Query_log_event's constructor based on the
        CF_CAN_GENERATE_ROW_EVENTS flag and as such any statement
        that has the associated flag should go through a cache
        before being written to the binary log.
     @ sql/mysql_priv.h
        Added a function to check the CF_CAN_GENERATE_ROW_EVENTS.
     @ sql/sql_class.cc
        Created a hook to be used by innodb that checks if a statement
        may write rows to the binary log. In other words, if it has
        the CF_CAN_GENERATE_ROW_EVENTS flag associated.
     @ sql/sql_class.h
        Defined the CF_CAN_GENERATE_ROW_EVENTS flag.
     @ sql/sql_parse.cc
        Updated the sql_command_flags and added a function to check the CF_CAN_GENERATE_ROW_EVENTS.
     @ storage/innobase/handler/ha_innodb.cc
        Added a call to the hook thd_generates_rows().
     @ storage/innobase/handler/ha_innodb.h
        Defined an external reference to the hook thd_generates_rows().
     @ storage/innodb_plugin/handler/ha_innodb.cc
        Added a call to the hook thd_generates_rows().
     @ storage/innodb_plugin/handler/ha_innodb.h
        Defined an external reference to the hook thd_generates_rows().
[19 Apr 2010 9:06] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/105963

3182 Alfranio Correia	2010-04-19
      BUG#50479 DDL stmt on row-only/stmt-only tables generate spurious binlog_format errors
      
      In the fix of BUG#39934 in 5.1-rep+3, errors are generated when
      binlog_format=row and a statement modifies a table restricted to
      statement-logging (ER_BINLOG_ROW_MODE_AND_STMT_ENGINE); or if
      binlog_format=statement and a statement modifies a table restricted to
      row-logging (ER_BINLOG_STMT_MODE_AND_ROW_ENGINE).
      
      However, some DDL statements that lock tables (e.g. ALTER TABLE,
      CREATE INDEX and CREATE TRIGGER) were causing spurious errors,
      although no row might be inserted into the binary log.
      
      To fix the problem, we tagged statements that may generate
      rows into the binary log and thence the warning messages are
      only printed out when the appropriate conditions hold and rows
      might be changed.
     @ mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result
        Added test case.
     @ mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt
        Added test case.
     @ mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test
        Added test case.
     @ sql/log_event.cc
        Reorganized the Query_log_event's constructor based on the
        CF_CAN_GENERATE_ROW_EVENTS flag and as such any statement
        that has the associated flag should go through a cache
        before being written to the binary log.
     @ sql/mysql_priv.h
        Added a function to check the CF_CAN_GENERATE_ROW_EVENTS.
     @ sql/sql_class.cc
        Created a hook to be used by innodb that checks if a statement
        may write rows to the binary log. In other words, if it has
        the CF_CAN_GENERATE_ROW_EVENTS flag associated.
     @ sql/sql_class.h
        Defined the CF_CAN_GENERATE_ROW_EVENTS flag.
     @ sql/sql_parse.cc
        Updated the sql_command_flags and added a function to check the CF_CAN_GENERATE_ROW_EVENTS.
     @ storage/innobase/handler/ha_innodb.cc
        Added a call to the hook thd_generates_rows().
     @ storage/innobase/handler/ha_innodb.h
        Defined an external reference to the hook thd_generates_rows().
     @ storage/innodb_plugin/handler/ha_innodb.cc
        Added a call to the hook thd_generates_rows().
     @ storage/innodb_plugin/handler/ha_innodb.h
        Defined an external reference to the hook thd_generates_rows().
[22 Apr 2010 9:37] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/106343

3182 Alfranio Correia	2010-04-22
      BUG#50479 DDL stmt on row-only/stmt-only tables generate spurious binlog_format errors
      
      In the fix of BUG#39934 in 5.1-rep+3, errors are generated when
      binlog_format=row and a statement modifies a table restricted to
      statement-logging (ER_BINLOG_ROW_MODE_AND_STMT_ENGINE); or if
      binlog_format=statement and a statement modifies a table restricted to
      row-logging (ER_BINLOG_STMT_MODE_AND_ROW_ENGINE).
      
      However, some DDL statements that lock tables (e.g. ALTER TABLE,
      CREATE INDEX and CREATE TRIGGER) were causing spurious errors,
      although no row might be inserted into the binary log.
      
      To fix the problem, we tagged statements that may generate
      rows into the binary log and thence the warning messages are
      only printed out when the appropriate conditions hold and rows
      might be changed.
     @ mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result
        Added test case.
     @ mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt
        Added test case.
     @ mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test
        Added test case.
     @ sql/log_event.cc
        Reorganized the Query_log_event's constructor based on the
        CF_CAN_GENERATE_ROW_EVENTS flag and as such any statement
        that has the associated flag should go through a cache
        before being written to the binary log.
     @ sql/mysql_priv.h
        Added a function to check the CF_CAN_GENERATE_ROW_EVENTS.
     @ sql/sql_class.cc
        Created a hook to be used by innodb that checks if a statement
        may write rows to the binary log. In other words, if it has
        the CF_CAN_GENERATE_ROW_EVENTS flag associated.
     @ sql/sql_class.h
        Defined the CF_CAN_GENERATE_ROW_EVENTS flag.
     @ sql/sql_parse.cc
        Updated the sql_command_flags and added a function to check the CF_CAN_GENERATE_ROW_EVENTS.
     @ storage/innobase/handler/ha_innodb.cc
        Added a call to the hook thd_generates_rows().
     @ storage/innobase/handler/ha_innodb.h
        Defined an external reference to the hook thd_generates_rows().
     @ storage/innodb_plugin/handler/ha_innodb.cc
        Added a call to the hook thd_generates_rows().
     @ storage/innodb_plugin/handler/ha_innodb.h
        Defined an external reference to the hook thd_generates_rows().
[26 Apr 2010 7:27] Marko Mäkelä
If we still support compiling InnoDB Plugin for an older version of MySQL 5.1, then the patch breaks that by not adding appropriate version check around the thd_generates_rows() in innodb_plugin/handler/ha_innodb.{cc,h}. Other than that, the patch looks fine to me.
[26 Apr 2010 19:37] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/106563

3017 Alfranio Correia	2010-04-26
      BUG#50479 DDL stmt on row-only/stmt-only tables generate spurious binlog_format errors
            
      In the fix of BUG#39934 in 5.1-rep+3, errors are generated when
      binlog_format=row and a statement modifies a table restricted to
      statement-logging (ER_BINLOG_ROW_MODE_AND_STMT_ENGINE); or if
      binlog_format=statement and a statement modifies a table restricted to
      row-logging (ER_BINLOG_STMT_MODE_AND_ROW_ENGINE).
            
      However, some DDL statements that lock tables (e.g. ALTER TABLE,
      CREATE INDEX and CREATE TRIGGER) were causing spurious errors,
      although no row might be inserted into the binary log.
            
      To fix the problem, we tagged statements that may generate
      rows into the binary log and thence the warning messages are
      only printed out when the appropriate conditions hold and rows
      might be changed.
     @ mysql-test/suite/binlog/r/binlog_spurious_ddl_errors.result
        Added test case.
     @ mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt
        Added test case.
     @ mysql-test/suite/binlog/t/binlog_spurious_ddl_errors.test
        Added test case.
     @ sql/log_event.cc
        Reorganized the Query_log_event's constructor based on the
        CF_CAN_GENERATE_ROW_EVENTS flag and as such any statement
        that has the associated flag should go through a cache
        before being written to the binary log.
     @ sql/sql_class.cc
        Created a hook to be used by innodb that checks if a statement
        may write rows to the binary log. In other words, if it has
        the CF_CAN_GENERATE_ROW_EVENTS flag associated.
     @ sql/sql_class.h
        Defined the CF_CAN_GENERATE_ROW_EVENTS flag.
     @ sql/sql_parse.cc
        Updated the sql_command_flags and added a function to check the 
        CF_CAN_GENERATE_ROW_EVENTS.
     @ sql/sql_parse.h
        Added a function to check the CF_CAN_GENERATE_ROW_EVENTS.
     @ storage/innobase/handler/ha_innodb.cc
        Added a call to the hook thd_generates_rows().
     @ storage/innobase/handler/ha_innodb.h
        Defined an external reference to the hook thd_generates_rows().
[4 May 2010 14:01] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/107344

3029 Alfranio Correia	2010-05-04
      BUG#50479 DDL stmt on row-only/stmt-only tables generate spurious binlog_format errors
            
      In the fix of BUG#39934 in 5.1-rep+3, errors are generated when
      binlog_format=row and a statement modifies a table restricted to
      statement-logging (ER_BINLOG_ROW_MODE_AND_STMT_ENGINE); or if
      binlog_format=statement and a statement modifies a table restricted to
      row-logging (ER_BINLOG_STMT_MODE_AND_ROW_ENGINE).
            
      However, some DDL statements that lock tables (e.g. ALTER TABLE,
      CREATE INDEX and CREATE TRIGGER) were causing spurious errors,
      although no row might be inserted into the binary log.
            
      To fix the problem, we tagged statements that may generate
      rows into the binary log and thence the warning messages are
      only printed out when the appropriate conditions hold and rows
      might be changed.
     @ sql/log_event.cc
        Reorganized the Query_log_event's constructor based on the
        CF_CAN_GENERATE_ROW_EVENTS flag and as such any statement
        that has the associated flag should go through a cache
        before being written to the binary log.
     @ sql/share/errmsg-utf8.txt
        Improved the error message ER_BINLOG_UNSAFE_MIXED_STATEMENT according to Paul's suggestion.
     @ sql/sql_class.cc
        Created a hook to be used by innodb that checks if a statement
        may write rows to the binary log. In other words, if it has
        the CF_CAN_GENERATE_ROW_EVENTS flag associated.
     @ sql/sql_class.h
        Defined the CF_CAN_GENERATE_ROW_EVENTS flag.
     @ sql/sql_parse.cc
        Updated the sql_command_flags and added a function to check the 
        CF_CAN_GENERATE_ROW_EVENTS.
     @ sql/sql_parse.h
        Added a function to check the CF_CAN_GENERATE_ROW_EVENTS.
     @ storage/innobase/handler/ha_innodb.cc
        Added a call to the hook thd_generates_rows().
     @ storage/innobase/handler/ha_innodb.h
        Defined an external reference to the hook thd_generates_rows().
[1 Jun 2010 23:26] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/109830

3088 Alfranio Correia	2010-06-02
      BUG#50479 DDL stmt on row-only/stmt-only tables generate spurious binlog_format
      errors
                  
      In the fix of BUG#39934 in 5.1-rep+3, errors are generated when
      binlog_format=row and a statement modifies a table restricted to
      statement-logging (ER_BINLOG_ROW_MODE_AND_STMT_ENGINE); or if
      binlog_format=statement and a statement modifies a table restricted to
      row-logging (ER_BINLOG_STMT_MODE_AND_ROW_ENGINE).
                  
      However, some DDL statements that lock tables (e.g. ALTER TABLE,
      CREATE INDEX and CREATE TRIGGER) were causing spurious errors,
      although no row might be inserted into the binary log.
                  
      To fix the problem, we tagged statements that may generate
      rows into the binary log and thence the warning messages are
      only printed out when the appropriate conditions hold and rows
      might be changed.
     @ sql/log_event.cc
        Reorganized the Query_log_event's constructor based on the
        CF_CAN_GENERATE_ROW_EVENTS flag and as such any statement
        that has the associated flag should go through a cache
        before being written to the binary log.
     @ sql/share/errmsg-utf8.txt
        Improved the error message ER_BINLOG_UNSAFE_MIXED_STATEMENT according to Paul's
        suggestion.
     @ sql/sql_class.cc
        Created a hook to be used by innodb that checks if a statement
        may write rows to the binary log. In other words, if it has
        the CF_CAN_GENERATE_ROW_EVENTS flag associated.
     @ sql/sql_class.h
        Defined the CF_CAN_GENERATE_ROW_EVENTS flag.
     @ sql/sql_parse.cc
        Updated the sql_command_flags and added a function to check the 
        CF_CAN_GENERATE_ROW_EVENTS.
     @ sql/sql_parse.h
        Added a function to check the CF_CAN_GENERATE_ROW_EVENTS.
     @ storage/innobase/handler/ha_innodb.cc
        Added a call to the hook thd_generates_rows().
     @ storage/innobase/handler/ha_innodb.h
        Defined an external reference to the hook thd_generates_rows().
[15 Jun 2010 8:12] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100615080459-smuswd9ooeywcxuc) (version source revid:marko.makela@oracle.com-20100601134335-ccthwwru23kn09qw) (merge vers: 5.1.48) (pib:16)
[15 Jun 2010 8:28] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100615080558-cw01bzdqr1bdmmec) (version source revid:marko.makela@oracle.com-20100601134335-ccthwwru23kn09qw) (pib:16)
[13 Jul 2010 8:01] Jon Stephens
Documented in the 5.5.5 changelog as follows:

        DDL statements that lock tables (such as ALTER TABLE, CREATE
        INDEX, and CREATE TRIGGER) caused spurious
        ER_BINLOG_ROW_MODE_AND_STMT_ENGINE or
        ER_BINLOG_STMT_MODE_AND_ROW_ENGINE errors, even though they did
        not insert rows into any tables.

        NOTE: The error ER_BINLOG_ROW_MODE_AND_STMT_ENGINE is generated 
        when binlog_format=row and a statement modifies a table restricted 
        to statement-based logging; ER_BINLOG_STMT_MODE_AND_ROW_ENGINE is
        generated when binlog_format=statement and a statement modifies
        a table restricted to row-based logging.

Closed.
[4 Aug 2010 8:06] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:alik@sun.com-20100324081105-y72rautcea375zxm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 8:21] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804081533-c1d3rbipo9e8rt1s) (version source revid:alik@sun.com-20100324081105-y72rautcea375zxm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 23:22] Paul DuBois
Bug does not appear in any released 5.6.x version.