Commit 8c5b85dd authored by vasil's avatar vasil

branches/zip:

Fix "Bug#40360 Binlog related errors with binlog off" in InnoDB code in order
to have a Bug#40360-free InnoDB Plugin 1.0.2.

The fix does check whether binary logging is enabled in MySQL by accessing the
opt_bin_log global variable that is defined in sql/mysqld.cc.

In case MySQL does develop another solution to this via Bug#40360 then we can
revert this patch (except the mysql-tests).

The windows-plugin part of this fix will be committed as a separate commit to
ease eventual merge into branches/5.1 [note from the future: the separate
commit went into r2936].

Approved by:	Marko (https://svn.innodb.com/rb/r/39)
parent fe97ea6f
...@@ -81,6 +81,11 @@ extern pthread_mutex_t LOCK_thread_count; ...@@ -81,6 +81,11 @@ extern pthread_mutex_t LOCK_thread_count;
but we need it here */ but we need it here */
bool check_global_access(THD *thd, ulong want_access); bool check_global_access(THD *thd, ulong want_access);
#endif /* MYSQL_VERSION_ID < 50124 */ #endif /* MYSQL_VERSION_ID < 50124 */
/* we need to check if binary logging is enabled in
ha_innobase::external_lock(), see http://bugs.mysql.com/40360.
The variable opt_bin_log is defined in mysqld.cc inside #ifdef MYSQL_SERVER */
extern bool opt_bin_log;
#endif /* MYSQL_SERVER */ #endif /* MYSQL_SERVER */
/** to protect innobase_open_files */ /** to protect innobase_open_files */
...@@ -7697,8 +7702,9 @@ ha_innobase::external_lock( ...@@ -7697,8 +7702,9 @@ ha_innobase::external_lock(
{ {
ulong const binlog_format= thd_binlog_format(thd); ulong const binlog_format= thd_binlog_format(thd);
ulong const tx_isolation = thd_tx_isolation(ha_thd()); ulong const tx_isolation = thd_tx_isolation(ha_thd());
if (tx_isolation <= ISO_READ_COMMITTED && if (opt_bin_log
binlog_format == BINLOG_FORMAT_STMT) && tx_isolation <= ISO_READ_COMMITTED
&& binlog_format == BINLOG_FORMAT_STMT)
{ {
char buf[256]; char buf[256];
my_snprintf(buf, sizeof(buf), my_snprintf(buf, sizeof(buf),
......
SET TX_ISOLATION='READ-COMMITTED';
CREATE TABLE bug40360 (a INT) engine=innodb;
INSERT INTO bug40360 VALUES (1);
DROP TABLE bug40360;
#
# Make sure http://bugs.mysql.com/40360 remains fixed.
#
-- source include/not_embedded.inc
-- source include/have_innodb.inc
SET TX_ISOLATION='READ-COMMITTED';
# This is the default since MySQL 5.1.29 SET BINLOG_FORMAT='STATEMENT';
CREATE TABLE bug40360 (a INT) engine=innodb;
INSERT INTO bug40360 VALUES (1);
DROP TABLE bug40360;
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