mirror of
https://github.com/MariaDB/server.git
synced 2025-07-08 17:02:21 +03:00
merge of bug#58147, including rename of the new argument,
to_binlog -> binlog_stmt.
This commit is contained in:
@ -110,6 +110,7 @@ bool Alter_table_truncate_partition_statement::execute(THD *thd)
|
||||
ha_partition *partition;
|
||||
ulong timeout= thd->variables.lock_wait_timeout;
|
||||
TABLE_LIST *first_table= thd->lex->select_lex.table_list.first;
|
||||
bool binlog_stmt;
|
||||
DBUG_ENTER("Alter_table_truncate_partition_statement::execute");
|
||||
|
||||
/*
|
||||
@ -161,16 +162,18 @@ bool Alter_table_truncate_partition_statement::execute(THD *thd)
|
||||
partition= (ha_partition *) first_table->table->file;
|
||||
|
||||
/* Invoke the handler method responsible for truncating the partition. */
|
||||
if ((error= partition->truncate_partition(&thd->lex->alter_info)))
|
||||
if ((error= partition->truncate_partition(&thd->lex->alter_info,
|
||||
&binlog_stmt)))
|
||||
first_table->table->file->print_error(error, MYF(0));
|
||||
|
||||
/*
|
||||
All effects of a truncate operation are committed even if the
|
||||
operation fails. Thus, the query must be written to the binary
|
||||
log. The only exception is a unimplemented truncate method. Also,
|
||||
it is logged in statement format, regardless of the binlog format.
|
||||
log. The exception is a unimplemented truncate method or failure
|
||||
before any call to handler::truncate() is done.
|
||||
Also, it is logged in statement format, regardless of the binlog format.
|
||||
*/
|
||||
if (error != HA_ERR_WRONG_COMMAND)
|
||||
if (error != HA_ERR_WRONG_COMMAND && binlog_stmt)
|
||||
error|= write_bin_log(thd, !error, thd->query(), thd->query_length());
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user