summaryrefslogtreecommitdiff
path: root/sql/sql_partition_admin.cc
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2010-12-03 10:33:29 +0100
committerMattias Jonsson <mattias.jonsson@oracle.com>2010-12-03 10:33:29 +0100
commita998586d45f197fcf39b215c24c214142786d1fc (patch)
tree71faa78703f912c7baac07e52ee212b2f30b9b4e /sql/sql_partition_admin.cc
parent3ffab566196fb596e91eb9260d791d8578401b16 (diff)
parent2737a722785589eca70f4e25eaaa0d8f594462df (diff)
downloadmariadb-git-a998586d45f197fcf39b215c24c214142786d1fc.tar.gz
merge of bug#58147, including rename of the new argument,
to_binlog -> binlog_stmt.
Diffstat (limited to 'sql/sql_partition_admin.cc')
-rw-r--r--sql/sql_partition_admin.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc
index 8f6ab5803d7..cadfc587c1c 100644
--- a/sql/sql_partition_admin.cc
+++ b/sql/sql_partition_admin.cc
@@ -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());
/*