summaryrefslogtreecommitdiff
path: root/sql/sql_partition_admin.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-06-11 20:20:35 +0200
committerSergei Golubchik <serg@mariadb.org>2015-06-11 20:20:35 +0200
commit810cf362eae28d4a096e0acea7efa67dd32aa05b (patch)
tree4f7b2f858e8a57022e790bcac6d88b5e3451ee0f /sql/sql_partition_admin.cc
parenta99efc00a68fe2406343e63b67fc4ea58bed345a (diff)
parentd199a0ffb0aac86881ea2db7dd78bc07b438dc67 (diff)
downloadmariadb-git-810cf362eae28d4a096e0acea7efa67dd32aa05b.tar.gz
Merge branch '5.5' into 10.0
Diffstat (limited to 'sql/sql_partition_admin.cc')
-rw-r--r--sql/sql_partition_admin.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc
index 8c59febeb77..87803c220ea 100644
--- a/sql/sql_partition_admin.cc
+++ b/sql/sql_partition_admin.cc
@@ -824,9 +824,16 @@ bool Sql_cmd_alter_table_truncate_partition::execute(THD *thd)
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.
+
+ Since we've changed data within the table, we also have to invalidate
+ the query cache for it.
*/
- if (error != HA_ERR_WRONG_COMMAND && binlog_stmt)
- error|= write_bin_log(thd, !error, thd->query(), thd->query_length());
+ if (error != HA_ERR_WRONG_COMMAND)
+ {
+ query_cache_invalidate3(thd, first_table, FALSE);
+ if (binlog_stmt)
+ error|= write_bin_log(thd, !error, thd->query(), thd->query_length());
+ }
/*
A locked table ticket was upgraded to a exclusive lock. After the