mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 11:01:52 +01:00
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)
This commit is contained in:
parent
fe97ea6f34
commit
8c5b85dd78
3 changed files with 28 additions and 2 deletions
|
@ -81,6 +81,11 @@ extern pthread_mutex_t LOCK_thread_count;
|
|||
but we need it here */
|
||||
bool check_global_access(THD *thd, ulong want_access);
|
||||
#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 */
|
||||
|
||||
/** to protect innobase_open_files */
|
||||
|
@ -7697,8 +7702,9 @@ ha_innobase::external_lock(
|
|||
{
|
||||
ulong const binlog_format= thd_binlog_format(thd);
|
||||
ulong const tx_isolation = thd_tx_isolation(ha_thd());
|
||||
if (tx_isolation <= ISO_READ_COMMITTED &&
|
||||
binlog_format == BINLOG_FORMAT_STMT)
|
||||
if (opt_bin_log
|
||||
&& tx_isolation <= ISO_READ_COMMITTED
|
||||
&& binlog_format == BINLOG_FORMAT_STMT)
|
||||
{
|
||||
char buf[256];
|
||||
my_snprintf(buf, sizeof(buf),
|
||||
|
|
4
mysql-test/innodb_bug40360.result
Normal file
4
mysql-test/innodb_bug40360.result
Normal file
|
@ -0,0 +1,4 @@
|
|||
SET TX_ISOLATION='READ-COMMITTED';
|
||||
CREATE TABLE bug40360 (a INT) engine=innodb;
|
||||
INSERT INTO bug40360 VALUES (1);
|
||||
DROP TABLE bug40360;
|
16
mysql-test/innodb_bug40360.test
Normal file
16
mysql-test/innodb_bug40360.test
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
# 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;
|
Loading…
Add table
Reference in a new issue