summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2013-10-04 18:50:47 +0400
committerSergey Petrunya <psergey@askmonty.org>2013-10-04 18:50:47 +0400
commit5e4044e92c748c69965bd9b22f231815c9fa8e51 (patch)
treed874a92db35df46b362675503d4d850a82815d85 /sql/sql_delete.cc
parent6519ca51dd8815dc1f2d88708e540bd4032cb45e (diff)
downloadmariadb-git-5e4044e92c748c69965bd9b22f231815c9fa8e51.tar.gz
MDEV-5093, MDEV-5094:
- Make EXPLAIN {PARTITIONS,EXTENDED} {UPDATE,DELETE} work.
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc21
1 files changed, 19 insertions, 2 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 25fe56d2e71..adc998be3a1 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -40,7 +40,7 @@
#include "records.h" // init_read_record,
#include "sql_derived.h" // mysql_handle_list_of_derived
// end_read_record
-
+#include "sql_partition.h" // make_used_partitions_str
/*
@brief
@@ -92,7 +92,24 @@ void Update_plan::save_qpf_intern(QPF_query *query, QPF_update *qpf)
select_lex->set_explain_type(TRUE);
qpf->select_type= select_lex->type;
-
+ /* Partitions */
+ {
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+ partition_info *part_info;
+ if ((part_info= table->part_info))
+ {
+ make_used_partitions_str(part_info, &qpf->used_partitions);
+ qpf->used_partitions_set= true;
+ }
+ else
+ qpf->used_partitions_set= false;
+#else
+ /* just produce empty column if partitioning is not compiled in */
+ qpf->used_partitions_set= false;
+#endif
+ }
+
+
/* Set jtype */
if (select && select->quick)
{