MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:kroki Date:October 3 2006 8:43am
Subject:bk commit into 5.1 tree (kroki:1.2338)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomash. When tomash 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-03 12:43:14+04:00, kroki@stripped +2 -0
  Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-real
  into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-real-bug21726
  MERGE: 1.2328.3.11

  sql/sql_select.cc@stripped, 2006-10-03 12:43:09+04:00, kroki@stripped +0 -0
    Auto merged
    MERGE: 1.448.1.1

  sql/sql_update.cc@stripped, 2006-10-03 12:43:10+04:00, kroki@stripped +0 -0
    Auto merged
    MERGE: 1.206.1.1

# 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:	kroki
# Host:	moonlight.intranet
# Root:	/home/tomash/src/mysql_ab/mysql-5.1-real-bug21726/RESYNC

--- 1.449/sql/sql_select.cc	2006-10-03 12:43:23 +04:00
+++ 1.450/sql/sql_select.cc	2006-10-03 12:43:23 +04:00
@@ -1137,17 +1137,28 @@ JOIN::optimize()
 
     tmp_table_param.hidden_field_count= (all_fields.elements -
 					 fields_list.elements);
+    ORDER *tmp_group= ((!simple_group && !procedure &&
+                        !(test_flags & TEST_NO_KEY_GROUP)) ? group_list :
+                                                             (ORDER*) 0);
+    /*
+      Pushing LIMIT to the temporary table creation is not applicable
+      when there is ORDER BY or GROUP BY or there is no GROUP BY, but
+      there are aggregate functions, because in all these cases we need
+      all result rows.
+    */
+    ha_rows tmp_rows_limit= ((order == 0 || skip_sort_order ||
+                              test(select_options & OPTION_BUFFER_RESULT)) &&
+                             !tmp_group &&
+                             !thd->lex->current_select->with_sum_func) ?
+                            select_limit : HA_POS_ERROR;
+
     if (!(exec_tmp_table1=
 	  create_tmp_table(thd, &tmp_table_param, all_fields,
-			   ((!simple_group && !procedure &&
-			     !(test_flags & TEST_NO_KEY_GROUP)) ?
-			    group_list : (ORDER*) 0),
+                           tmp_group,
 			   group_list ? 0 : select_distinct,
 			   group_list && simple_group,
 			   select_options,
-			   (order == 0 || skip_sort_order || 
-                            test(select_options & OPTION_BUFFER_RESULT)) ? 
-                             select_limit : HA_POS_ERROR,
+                           tmp_rows_limit,
 			   (char *) "")))
       DBUG_RETURN(1);
 
@@ -9302,6 +9313,13 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
                               thd->variables.max_heap_table_size) :
                           thd->variables.tmp_table_size)/ share->reclength);
   set_if_bigger(share->max_rows,1);		// For dummy start options
+  /*
+    Push the LIMIT clause to the temporary table creation, so that we
+    materialize only up to 'rows_limit' records instead of all result records.
+  */
+  set_if_smaller(share->max_rows, rows_limit);
+  param->end_write_records= rows_limit;
+
   keyinfo= param->keyinfo;
 
   if (group)
@@ -9432,19 +9450,6 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
 	 (ha_base_keytype) key_part_info->type == HA_KEYTYPE_VARTEXT2) ?
 	0 : FIELDFLAG_BINARY;
     }
-  }
-
-  /*
-    Push the LIMIT clause to the temporary table creation, so that we
-    materialize only up to 'rows_limit' records instead of all result records.
-    This optimization is not applicable when there is GROUP BY or there is
-    no GROUP BY, but there are aggregate functions, because both must be
-    computed for all result rows.
-  */
-  if (!group && !thd->lex->current_select->with_sum_func)
-  {
-    set_if_smaller(table->s->max_rows, rows_limit);
-    param->end_write_records= rows_limit;
   }
 
   if (thd->is_fatal_error)				// If end of memory
Thread
bk commit into 5.1 tree (kroki:1.2338)kroki3 Oct