List:Internals« Previous MessageNext Message »
From:sinisa Date:October 5 2004 11:47am
Subject:bk commit into 4.0 tree (Sinisa:1.2037)
View as plain text  
Below is the list of changes that have just been committed into a local
4.0 repository of Sinisa. When Sinisa does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.2037 04/10/05 14:47:10 Sinisa@stripped +1 -0
  Fix for wrongly calculated Examined_rows in 4.0 UNION's.

  sql/sql_union.cc
    1.50 04/10/05 14:47:03 Sinisa@stripped +7 -2
    Fixing a non-critical bug in 4.0 UNION's which results in erronously 
    calculated number o fexamined rows. This value is displayed in the 
    slow query log.
    
    This is a bug number #5879.
     

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	Sinisa
# Host:	sinisa.nasamreza.org
# Root:	/mnt/work/mysql-4.0

--- 1.49/sql/sql_union.cc	Fri Sep  3 17:59:27 2004
+++ 1.50/sql/sql_union.cc	Tue Oct  5 14:47:03 2004
@@ -39,6 +39,7 @@
   TABLE_LIST *first_table=(TABLE_LIST *)lex->select_lex.table_list.first;
   TMP_TABLE_PARAM tmp_table_param;
   select_union *union_result;
+  ha_rows examined_rows= 0;
   DBUG_ENTER("mysql_union");
 
   /* Fix tables 'to-be-unioned-from' list to point at opened tables */
@@ -202,6 +203,7 @@
 		     union_result);
     if (res)
       goto exit;
+    examined_rows+= thd->examined_row_count;
     /* Needed for the following test and for records_at_start in next loop */
     table->file->info(HA_STATUS_VARIABLE);
     if (found_rows_for_union & sl->options)
@@ -258,12 +260,15 @@
       if (describe)
 	thd->select_limit= HA_POS_ERROR;		// no limit
       
-      res=mysql_select(thd,&result_table_list,
+      res= mysql_select(thd,&result_table_list,
 		       item_list, NULL, (describe) ? 0 : order,
 		       (ORDER*) NULL, NULL, (ORDER*) NULL,
 		       thd->options, result);
       if (!res)
-	thd->limit_found_rows = (ulonglong)table->file->records + add_rows;
+      {
+	thd->limit_found_rows= (ulonglong)table->file->records + add_rows;
+	thd->examined_row_count+= examined_rows;
+      }
     }
   }
 
Thread
bk commit into 4.0 tree (Sinisa:1.2037)sinisa5 Oct