diff options
author | unknown <guilhem@mysql.com> | 2004-11-04 19:19:23 +0100 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2004-11-04 19:19:23 +0100 |
commit | e30bd1e48d8ef68a92dd8443611b1e3d8e356c7a (patch) | |
tree | 23f091178f7dabb42c78d784be8ed29ee37faa37 /sql/log.cc | |
parent | 9c06c80dff5744ac0b1d214404c9d16f752e41bb (diff) | |
download | mariadb-git-e30bd1e48d8ef68a92dd8443611b1e3d8e356c7a.tar.gz |
Fix for BUG##5714 "Insert into MyISAM table and select ... for update]":
the fact that the transaction log is empty does not mean we're not in a transaction
(it could be BEGIN; SELECT * FOR UPDATE FROM ibtable: then we don't want to commit now, even if
the statement is a MyISAM update).
With a testcase.
mysql-test/r/mix_innodb_myisam_binlog.result:
result update
mysql-test/t/mix_innodb_myisam_binlog.test:
test update for a new bug
sql/log.cc:
The fact that the transaction log is empty does not mean we're not in a transaction
(it could be BEGIN; SELECT * FOR UPDATE: then we don't want to commit now).
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/log.cc b/sql/log.cc index fee77b38f21..aa5d9d8753b 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1254,7 +1254,8 @@ bool MYSQL_LOG::write(Log_event* event_info) if (flush_io_cache(file)) goto err; - if (opt_using_transactions && !my_b_tell(&thd->transaction.trans_log)) + if (opt_using_transactions && + !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) { /* LOAD DATA INFILE in AUTOCOMMIT=1 mode writes to the binlog |