List:Commits« Previous MessageNext Message »
From:ingo Date:October 19 2006 7:59am
Subject:bk commit into 5.0 tree (istruewing:1.2282)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of istruewing. When istruewing 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://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-10-19 09:59:01+02:00, istruewing@stripped +1 -0
  Merge bk-internal.mysql.com:/home/bk/mysql-5.0
  into  chilla.local:/home/mydev/mysql-5.0-merge
  MERGE: 1.2277.1.2

  sql/sql_select.cc@stripped, 2006-10-19 09:58:49+02:00, istruewing@stripped +0 -0
    Auto merged
    MERGE: 1.459.1.4

# 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:	istruewing
# Host:	chilla.local
# Root:	/home/mydev/mysql-5.0-merge/RESYNC

--- 1.463/sql/sql_select.cc	2006-10-19 09:59:23 +02:00
+++ 1.464/sql/sql_select.cc	2006-10-19 09:59:23 +02:00
@@ -1375,12 +1375,13 @@ JOIN::exec()
     thd->examined_row_count= 0;
     DBUG_VOID_RETURN;
   }
-  /* 
-    don't reset the found rows count if there're no tables
-    as FOUND_ROWS() may be called.
-  */  
+  /*
+    Don't reset the found rows count if there're no tables as
+    FOUND_ROWS() may be called. Never reset the examined row count here.
+    It must be accumulated from all join iterations of all join parts.
+  */
   if (tables)
-    thd->limit_found_rows= thd->examined_row_count= 0;
+    thd->limit_found_rows= 0;
 
   if (zero_result_cause)
   {
@@ -1428,6 +1429,12 @@ JOIN::exec()
   List<Item> *curr_all_fields= &all_fields;
   List<Item> *curr_fields_list= &fields_list;
   TABLE *curr_tmp_table= 0;
+  /*
+    Initialize examined rows here because the values from all join parts
+    must be accumulated in examined_row_count. Hence every join
+    iteration must count from zero.
+  */
+  curr_join->examined_rows= 0;
 
   if ((curr_join->select_lex->options & OPTION_SCHEMA_TABLE) &&
       get_schema_tables_result(curr_join))
@@ -1834,9 +1841,12 @@ JOIN::exec()
                         Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF);
     error= do_select(curr_join, curr_fields_list, NULL, procedure);
     thd->limit_found_rows= curr_join->send_records;
-    thd->examined_row_count= curr_join->examined_rows;
   }
 
+  /* Accumulate the counts from all join iterations of all join parts. */
+  thd->examined_row_count+= curr_join->examined_rows;
+  DBUG_PRINT("counts", ("thd->examined_row_count: %lu",
+                        (ulong) thd->examined_row_count));
   DBUG_VOID_RETURN;
 }
 
@@ -10141,6 +10151,8 @@ evaluate_join_record(JOIN *join, JOIN_TA
     */
     join->examined_rows++;
     join->thd->row_count++;
+    DBUG_PRINT("counts", ("join->examined_rows++: %lu",
+                          (ulong) join->examined_rows));
 
     if (found)
     {
Thread
bk commit into 5.0 tree (istruewing:1.2282)ingo19 Oct