diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test index 99c207e31a0..05d36b8b831 100644 --- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test +++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test @@ -270,17 +270,3 @@ disconnect con3; connection con4; select get_lock("a",10); # wait for rollback to finish - -# we check that the error code of the "ROLLBACK" event is 0 and not -# ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction -# and does not make slave to stop) ---exec $MYSQL_BINLOG --start-position=547 $MYSQL_TEST_DIR/var/log/master-bin.000001 > var/tmp/mix_innodb_myisam_binlog.output ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR -eval select -(@a:=load_file("$MYSQL_TEST_DIR/var/tmp/mix_innodb_myisam_binlog.output")) -is not null; ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR -eval select -@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%", -@a not like "%#%error_code=%error_code=%"; -drop table t1, t2; diff --git a/mysql-test/r/binlog_row_mix_innodb_myisam.result b/mysql-test/r/binlog_row_mix_innodb_myisam.result index d1589ce495b..72e5cfa1cae 100644 --- a/mysql-test/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/r/binlog_row_mix_innodb_myisam.result @@ -281,3 +281,27 @@ master-bin.000001 1092 Write_rows 1 # master-bin.000001 1126 Query 1 # use `test`; create table t2 (n int) engine=innodb do release_lock("lock1"); drop table t0,t2; +reset master; +create table t1 (a int) engine=innodb; +create table t2 (a int) engine=myisam; +select get_lock("a",10); +get_lock("a",10) +1 +begin; +insert into t1 values(8); +insert into t2 select * from t1; +select get_lock("a",10); +get_lock("a",10) +1 +select +(@a:=load_file("MYSQL_TEST_DIR/var/tmp/mix_innodb_myisam_binlog.output")) +is not null; +(@a:=load_file("MYSQL_TEST_DIR/var/tmp/mix_innodb_myisam_binlog.output")) +is not null +1 +select +@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%", +@a not like "%#%error_code=%error_code=%"; +@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%" +1 1 +drop table t1, t2; diff --git a/mysql-test/r/rpl_row_UUID.result b/mysql-test/r/rpl_row_UUID.result index 36aa3c625bb..8043148a542 100644 --- a/mysql-test/r/rpl_row_UUID.result +++ b/mysql-test/r/rpl_row_UUID.result @@ -32,7 +32,7 @@ t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0', `blob_column` longblob, `vchar_column` varchar(100) default NULL, - PRIMARY KEY (`a`) + PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP PROCEDURE test.p1; DROP FUNCTION test.fn1; diff --git a/mysql-test/t/binlog_row_mix_innodb_myisam.test b/mysql-test/t/binlog_row_mix_innodb_myisam.test index 7986467e5e5..75ed62e810e 100644 --- a/mysql-test/t/binlog_row_mix_innodb_myisam.test +++ b/mysql-test/t/binlog_row_mix_innodb_myisam.test @@ -3,3 +3,21 @@ -- source include/have_binlog_format_row.inc -- source extra/binlog_tests/mix_innodb_myisam_binlog.test + +# This piece below cannot be put into +# extra/binlog_tests/mix_innodb_myisam_binlog.test +# because the argument of --start-position differs between statement- +# and row-based (and "eval --exec" doesn't work). +# we check that the error code of the "ROLLBACK" event is 0 and not +# ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction +# and does not make slave to stop) +--exec $MYSQL_BINLOG --start-position=516 $MYSQL_TEST_DIR/var/log/master-bin.000001 > var/tmp/mix_innodb_myisam_binlog.output +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +eval select +(@a:=load_file("$MYSQL_TEST_DIR/var/tmp/mix_innodb_myisam_binlog.output")) +is not null; +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +eval select +@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%", +@a not like "%#%error_code=%error_code=%"; +drop table t1, t2; diff --git a/mysql-test/t/binlog_stm_mix_innodb_myisam.test b/mysql-test/t/binlog_stm_mix_innodb_myisam.test index 2e096aebe1e..953e1075d06 100644 --- a/mysql-test/t/binlog_stm_mix_innodb_myisam.test +++ b/mysql-test/t/binlog_stm_mix_innodb_myisam.test @@ -3,3 +3,21 @@ -- source include/have_binlog_format_statement.inc -- source extra/binlog_tests/mix_innodb_myisam_binlog.test + +# This piece below cannot be put into +# extra/binlog_tests/mix_innodb_myisam_binlog.test +# because the argument of --start-position differs between statement- +# and row-based (and "eval --exec" doesn't work). +# we check that the error code of the "ROLLBACK" event is 0 and not +# ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction +# and does not make slave to stop) +--exec $MYSQL_BINLOG --start-position=551 $MYSQL_TEST_DIR/var/log/master-bin.000001 > var/tmp/mix_innodb_myisam_binlog.output +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +eval select +(@a:=load_file("$MYSQL_TEST_DIR/var/tmp/mix_innodb_myisam_binlog.output")) +is not null; +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +eval select +@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%", +@a not like "%#%error_code=%error_code=%"; +drop table t1, t2; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 6e70265c8bc..e1c8ed966ee 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5228,8 +5228,8 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite, */ {"log-bin-trust-function-creators", OPT_LOG_BIN_TRUST_FUNCTION_CREATORS, "If equal to 0 (the default), then when --log-bin is used, creation of " - "a function (a trigger) is allowed only to users having the SUPER privilege " - "and only if this function (trigger) may not break binary logging." + "a stored function (or trigger) is allowed only to users having the SUPER privilege " + "and only if this stored function (trigger) 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." diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 301d88c8775..1f29468a61f 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -749,12 +749,6 @@ int cmp_splocal_locations(Item_splocal * const *a, Item_splocal * const *b) written into binary log. Instead we catch function calls the statement makes and write it into binary log separately (see #3). - We actually can easily write SELECT statements into the binary log in the - right order (we don't have issues with const tables being unlocked early - because SELECTs that use FUNCTIONs unlock all tables at once) We don't do - it because replication slave thread currently can't execute SELECT - statements. Fixing this is on the TODO. - 2. PROCEDURE calls CALL statements are not written into binary log. Instead @@ -775,7 +769,7 @@ int cmp_splocal_locations(Item_splocal * const *a, Item_splocal * const *b) function execution (grep for start_union_events and stop_union_events) If the answers are No and Yes, we write the function call into the binary - log as "DO spfunc(, , ...)" + log as "SELECT spfunc(, , ...)" 4. Miscellaneous issues. @@ -1327,7 +1321,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, char buf[256]; String bufstr(buf, sizeof(buf), &my_charset_bin); bufstr.length(0); - bufstr.append(STRING_WITH_LEN("DO ")); + bufstr.append(STRING_WITH_LEN("SELECT ")); append_identifier(thd, &bufstr, m_name.str, m_name.length); bufstr.append('('); for (uint i=0; i < argcount; i++)