mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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.)
This commit is contained in:
@ -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;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user