[Commits] Rev 3687: [SHOW] EXPLAIN UPDATE/DELETE in file:///data0/psergey/dev2/10.0-base-explain-update-r10/

Sergey Petrunya psergey at askmonty.org
Mon Aug 26 13:43:53 EEST 2013


At file:///data0/psergey/dev2/10.0-base-explain-update-r10/

------------------------------------------------------------
revno: 3687
revision-id: psergey at askmonty.org-20130826104352-4lng6awlhpp8s3tm
parent: psergey at askmonty.org-20130824082051-yjc8v62a0fx320w2
committer: Sergey Petrunya <psergey at askmonty.org>
branch nick: 10.0-base-explain-update-r10
timestamp: Mon 2013-08-26 14:43:52 +0400
message:
  [SHOW] EXPLAIN UPDATE/DELETE
  - Post-merge fixes (conflict with DELETE .. RETURNING)
  - Add a testcase with EXPLAIN ... DELETE ... RETURNING
=== modified file 'mysql-test/t/explain_non_select.test'
--- a/mysql-test/t/explain_non_select.test	2013-06-18 15:21:00 +0000
+++ b/mysql-test/t/explain_non_select.test	2013-08-26 10:43:52 +0000
@@ -84,3 +84,14 @@ explain update t0, t1 set t1.a=t1.a+1 wh
 
 
 drop table t0, t1;
+
+--echo #
+--echo # Try DELETE ... RETURNING ...
+--echo #
+create table t0 (a int);
+insert into t0 values (1),(2),(3),(4);
+explain delete from t0 where a=1 returning a;
+explain delete from t0 returning a;
+drop table t0;
+
+

=== modified file 'sql/sql_delete.cc'
--- a/sql/sql_delete.cc	2013-08-24 08:20:51 +0000
+++ b/sql/sql_delete.cc	2013-08-26 10:43:52 +0000
@@ -658,18 +658,18 @@ bool mysql_delete(THD *thd, TABLE_LIST *
 exit_without_my_ok:
   query_plan.save_query_plan_footprint(thd->lex->query_plan_footprint);
 
-  select_send *result;
-  if (!(result= new select_send()))
+  select_send *result2;
+  if (!(result2= new select_send()))
     return 1;                               /* purecov: inspected */
   List<Item> dummy; /* note: looked in 5.6 and they too use a dummy list like this */
-  result->prepare(dummy, &thd->lex->unit);
-  thd->send_explain_fields(result);
-  int err2= thd->lex->query_plan_footprint->print_explain(result, 0 /* explain flags*/);
+  result2->prepare(dummy, &thd->lex->unit);
+  thd->send_explain_fields(result2);
+  int err2= thd->lex->query_plan_footprint->print_explain(result2, 0 /* explain flags*/);
 
   if (err2)
-    result->abort_result_set();
+    result2->abort_result_set();
   else
-    result->send_eof();
+    result2->send_eof();
   
   delete select;
   free_underlaid_joins(thd, select_lex);



More information about the commits mailing list