[Commits] Rev 3503: MWL#182: Explain running statements in file:///home/psergey/dev2/5.3-show-explain-r20/

Sergey Petrunya psergey at askmonty.org
Thu Apr 26 04:47:35 EEST 2012


At file:///home/psergey/dev2/5.3-show-explain-r20/

------------------------------------------------------------
revno: 3503
revision-id: psergey at askmonty.org-20120426014734-1az0fcps2270w100
parent: psergey at askmonty.org-20120426011036-eaosozjasypr49o1
committer: Sergey Petrunya <psergey at askmonty.org>
branch nick: 5.3-show-explain-r20
timestamp: Thu 2012-04-26 07:17:34 +0530
message:
  MWL#182: Explain running statements
  - Correct thd->killed checks in join cache and filesort modules.
=== modified file 'sql/filesort.cc'
--- a/sql/filesort.cc	2012-04-05 21:07:18 +0000
+++ b/sql/filesort.cc	2012-04-26 01:47:34 +0000
@@ -493,7 +493,7 @@
   my_off_t record;
   TABLE *sort_form;
   THD *thd= current_thd;
-  volatile killed_state *killed= &thd->killed;
+  //volatile killed_state *killed= &thd->killed;
   handler *file;
   MY_BITMAP *save_read_set, *save_write_set, *save_vcol_set;
   uchar *next_sort_key= sort_keys_buf;
@@ -588,7 +588,7 @@
 	break;
     }
 
-    if (*killed)
+    if (thd->check_killed())
     {
       DBUG_PRINT("info",("Sort killed by user"));
       if (!indexfile && !quick_select)
@@ -1229,18 +1229,20 @@
   void *first_cmp_arg;
   element_count dupl_count= 0;
   uchar *src;
-  killed_state not_killable;
+  /* killed_state not_killable; */
   uchar *unique_buff= param->unique_buff;
-  volatile killed_state *killed= &current_thd->killed;
+  /* volatile killed_state *killed= &current_thd->killed; */
+  const bool killable= !param->not_killable;
+  THD* const thd=current_thd;
   DBUG_ENTER("merge_buffers");
 
-  status_var_increment(current_thd->status_var.filesort_merge_passes);
-  current_thd->query_plan_fsort_passes++;
-  if (param->not_killable)
+  status_var_increment(thd->status_var.filesort_merge_passes);
+  thd->query_plan_fsort_passes++;
+  /*if (param->not_killable)
   {
     killed= &not_killable;
     not_killable= NOT_KILLED;
-  }
+  }*/
 
   error=0;
   rec_length= param->rec_length;
@@ -1317,7 +1319,7 @@
 
   while (queue.elements > 1)
   {
-    if (*killed)
+    if (killable && thd->check_killed())
     {
       error= 1; goto err;                        /* purecov: inspected */
     }

=== modified file 'sql/sql_join_cache.cc'
--- a/sql/sql_join_cache.cc	2012-03-23 16:22:39 +0000
+++ b/sql/sql_join_cache.cc	2012-04-26 01:47:34 +0000
@@ -2235,7 +2235,7 @@
   
   while (!(error= join_tab_scan->next()))   
   {
-    if (join->thd->killed)
+    if (join->thd->check_killed())
     {
       /* The user has aborted the execution of the query */
       join->thd->send_kill_message();
@@ -2505,7 +2505,7 @@
 
   for ( ; cnt; cnt--)
   {
-    if (join->thd->killed)
+    if (join->thd->check_killed())
     {
       /* The user has aborted the execution of the query */
       join->thd->send_kill_message();
@@ -3355,7 +3355,7 @@
     update_virtual_fields(thd, table);
   while (!err && select && (skip_rc= select->skip_record(thd)) <= 0)
   {
-    if (thd->killed || skip_rc < 0) 
+    if (thd->check_killed() || skip_rc < 0) 
       return 1;
     /* 
       Move to the next record if the last retrieved record does not



More information about the commits mailing list