List:Internals« Previous MessageNext Message »
From:sanja Date:August 20 2003 8:57pm
Subject:bk commit into 4.1 tree (1.1577)
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of bell. When bell 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.1577 03/08/20 21:57:37 bell@stripped +3 -0
  quick fix for found row counter
  code cleunup

  sql/sql_update.cc
    1.96 03/08/20 21:57:29 bell@stripped +1 -1
    lelect_limit in THD is not used

  sql/sql_union.cc
    1.90 03/08/20 21:57:29 bell@stripped +15 -10
    quick fix for found row counter
    layout fixed

  sql/sql_class.h
    1.177 03/08/20 21:57:29 bell@stripped +1 -1
    removed unused variables

# 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:	bell
# Host:	laptop.sanja.is.com.ua
# Root:	/home/bell/mysql/bk/work-simple_in-4.1

--- 1.176/sql/sql_class.h	Tue Aug 19 00:08:02 2003
+++ 1.177/sql/sql_class.h	Wed Aug 20 21:57:29 2003
@@ -532,7 +532,7 @@
   */
   ulonglong  current_insert_id;
   ulonglong  limit_found_rows;
-  ha_rows    select_limit, offset_limit, cuted_fields,
+  ha_rows    cuted_fields,
              sent_row_count, examined_row_count;
   table_map  used_tables;
   USER_CONN *user_connect;

--- 1.95/sql/sql_update.cc	Tue Aug 19 19:50:51 2003
+++ 1.96/sql/sql_update.cc	Wed Aug 20 21:57:29 2003
@@ -423,7 +423,7 @@
     DBUG_RETURN(res);
   fix_tables_pointers(thd->lex.all_selects_list);
 
-  thd->select_limit=HA_POS_ERROR;
+  select_lex->select_limit= HA_POS_ERROR;
   if (setup_fields(thd, 0, table_list, *fields, 1, 0, 0))
     DBUG_RETURN(-1);
 

--- 1.89/sql/sql_union.cc	Wed Aug 20 17:45:00 2003
+++ 1.90/sql/sql_union.cc	Wed Aug 20 21:57:29 2003
@@ -123,7 +123,8 @@
     DBUG_RETURN(0);
   prepared= 1;
   res= 0;
-  found_rows_for_union= first_select_in_union()->options & OPTION_FOUND_ROWS;
+  found_rows_for_union= test(first_select_in_union()->options
+			     & OPTION_FOUND_ROWS);
   TMP_TABLE_PARAM tmp_table_param;
   result= sel_result;
   t_and_f= tables_and_fields_initied;
@@ -238,7 +239,7 @@
 {
   SELECT_LEX *lex_select_save= thd->lex.current_select;
   SELECT_LEX *select_cursor=first_select_in_union();
-  unsigned int add_rows=0;
+  ha_rows add_rows=0;
   DBUG_ENTER("st_select_lex_unit::exec");
 
   if (executed && !(dependent || uncacheable))
@@ -255,7 +256,7 @@
     }
     for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select())
     {
-      unsigned int rows;
+      ha_rows rows= 0;
       thd->lex.current_select= sl;
 
       if (optimized)
@@ -270,7 +271,7 @@
 	  sl->options&= ~OPTION_FOUND_ROWS;
 	else if (found_rows_for_union)
 	{
-	  rows= thd->select_limit;
+	  rows= sl->select_limit;
 	  sl->options|= OPTION_FOUND_ROWS;
 	}
 	
@@ -313,8 +314,10 @@
 	thd->lex.current_select= lex_select_save;
 	DBUG_RETURN(res);
       }
-      if (found_rows_for_union  && !sl->braces && sl->options &
OPTION_FOUND_ROWS)
-	add_rows+= (thd->limit_found_rows > rows) ?  thd->limit_found_rows - rows : 0;
+      if (found_rows_for_union  && !sl->braces &&
+	  (sl->options & OPTION_FOUND_ROWS))
+	add_rows+= (sl->join->send_records > rows) ?
+	  sl->join->send_records - rows : 0;
     }
   }
   optimized= 1;
@@ -329,18 +332,20 @@
 
     if (!thd->is_fatal_error)			// Check if EOM
     {
+      ulong options= thd->options;
       thd->lex.current_select= fake_select_lex;
       if (select_cursor->braces)
       {
 	offset_limit_cnt= global_parameters->offset_limit;
-	select_limit_cnt= global_parameters->select_limit + 
global_parameters->offset_limit;
+	select_limit_cnt= global_parameters->select_limit +
+	  global_parameters->offset_limit;
 	if (select_limit_cnt < global_parameters->select_limit)
 	  select_limit_cnt= HA_POS_ERROR;		// no limit
       }
       if (select_limit_cnt == HA_POS_ERROR)
-	thd->options&= ~OPTION_FOUND_ROWS;
+	options&= ~OPTION_FOUND_ROWS;
       else if (found_rows_for_union && !describe)
-	thd->options|= OPTION_FOUND_ROWS;
+	options|= OPTION_FOUND_ROWS;
       fake_select_lex->ftfunc_list= &empty_list;
       fake_select_lex->table_list.link_in_list((byte *)&result_table_list,
 					       (byte **)
@@ -375,7 +380,7 @@
 			global_parameters->order_list.elements,
 			(ORDER*)global_parameters->order_list.first,
 			(ORDER*) NULL, NULL, (ORDER*) NULL,
-			thd->options | SELECT_NO_UNLOCK,
+			options | SELECT_NO_UNLOCK,
 			result, this, fake_select_lex, 0);
       if (found_rows_for_union && !res)
       {
Thread
bk commit into 4.1 tree (1.1577)sanja21 Aug