diff options
author | jimw@mysql.com <> | 2004-12-03 00:05:11 +0100 |
---|---|---|
committer | jimw@mysql.com <> | 2004-12-03 00:05:11 +0100 |
commit | 13649d90ae90257620461cdd97bbf217bd1b1755 (patch) | |
tree | c6630df438ab32a1664bb54903e60729d5755629 /sql/sql_insert.cc | |
parent | 7ed2753300a9fe874149ba9f3d8255726c60414e (diff) | |
download | mariadb-git-13649d90ae90257620461cdd97bbf217bd1b1755.tar.gz |
Prevent adding 'CREATE TABLE .. SELECT' query to the binary log when the
insertion of new records partially failed. It would get logged because of the
logic to log a partially-failed 'INSERT ... SELECT' (which can't be rolled back
in non-transactional tables), but 'CREATE TABLE ... SELECT' is always rolled
back on failure, even for non-transactional tables. (Bug #6682)
(Original fix reimplemented after review by Serg and Guilhem.)
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r-- | sql/sql_insert.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 8912c1faf2a..0c62a9af7ba 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1505,6 +1505,19 @@ bool select_create::send_data(List<Item> &values) return 0; } + +void select_create::send_error(uint errcode,const char *err) +{ + /* + Disable binlog, because we "roll back" partial inserts in ::abort + by removing the table, even for non-transactional tables. + */ + tmp_disable_binlog(thd); + select_insert::send_error(errcode, err); + reenable_binlog(thd); +} + + extern HASH open_cache; |