List:Commits« Previous MessageNext Message »
From:igor Date:January 30 2007 9:14pm
Subject:bk commit into 5.0 tree (igor:1.2392)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of igor. When igor 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, 2007-01-30 13:14:52-08:00, igor@stripped +2 -0
  Merge olga.mysql.com:/home/igor/dev-opt/mysql-4.1-opt-bug24987
  into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug24987
  MERGE: 1.1616.2917.14

  sql/opt_sum.cc@stripped, 2007-01-30 13:09:25-08:00, igor@stripped +0 -0
    Auto merged
    MERGE: 1.33.6.4

  sql/sql_select.cc@stripped, 2007-01-30 13:14:50-08:00, igor@stripped +1 -0
    Manual merge
    MERGE: 1.216.125.18

# 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:	igor
# Host:	olga.mysql.com
# Root:	/home/igor/dev-opt/mysql-5.0-opt-bug24987/RESYNC

--- 1.60/sql/opt_sum.cc	2007-01-30 13:14:57 -08:00
+++ 1.61/sql/opt_sum.cc	2007-01-30 13:14:57 -08:00
@@ -67,9 +67,9 @@
     GROUP BY part.
 
   RETURN VALUES
-    0 No errors
-    1 if all items were resolved
-   -1 on impossible conditions
+    0                    no errors
+    1                    if all items were resolved
+    HA_ERR_KEY_NOT_FOUND on impossible conditions
     OR an error number from my_base.h HA_ERR_... if a deadlock or a lock
        wait timeout happens, for example
 */
@@ -224,7 +224,7 @@
           if (error)
 	  {
 	    if (error == HA_ERR_KEY_NOT_FOUND || error == HA_ERR_END_OF_FILE)
-	      return -1;		       // No rows matching WHERE
+	      return HA_ERR_KEY_NOT_FOUND;	      // No rows matching WHERE
 	    /* HA_ERR_LOCK_DEADLOCK or some other error */
  	    table->file->print_error(error, MYF(0));
             return(error);
@@ -311,7 +311,7 @@
           if (error)
           {
 	    if (error == HA_ERR_KEY_NOT_FOUND || error == HA_ERR_END_OF_FILE)
-	      return -1;		       // No rows matching WHERE
+	      return HA_ERR_KEY_NOT_FOUND;	     // No rows matching WHERE
 	    /* HA_ERR_LOCK_DEADLOCK or some other error */
  	    table->file->print_error(error, MYF(0));
             return(error);

--- 1.486/sql/sql_select.cc	2007-01-30 13:14:57 -08:00
+++ 1.487/sql/sql_select.cc	2007-01-30 13:14:57 -08:00
@@ -707,24 +707,26 @@
   {
     int res;
     /*
-      opt_sum_query() returns -1 if no rows match to the WHERE conditions,
-      or 1 if all items were resolved, or 0, or an error number HA_ERR_...
+      opt_sum_query() returns HA_ERR_KEY_NOT_FOUND if no rows match
+      to the WHERE conditions,
+      or 1 if all items were resolved,
+      or 0, or an error number HA_ERR_...
     */
     if ((res=opt_sum_query(select_lex->leaf_tables, all_fields, conds)))
     {
+      if (res == HA_ERR_KEY_NOT_FOUND)
+      {
+        DBUG_PRINT("info",("No matching min/max row"));
+	zero_result_cause= "No matching min/max row";
+	error=0;
+	DBUG_RETURN(0);
+      }
       if (res > 1)
       {
         thd->fatal_error();
         error= res;
         DBUG_PRINT("error",("Error from opt_sum_query"));
 	DBUG_RETURN(1);
-      }
-      if (res < 0)
-      {
-        DBUG_PRINT("info",("No matching min/max row"));
-	zero_result_cause= "No matching min/max row";
-	error=0;
-	DBUG_RETURN(0);
       }
       DBUG_PRINT("info",("Select tables optimized away"));
       zero_result_cause= "Select tables optimized away";
Thread
bk commit into 5.0 tree (igor:1.2392)igor30 Jan