List:Commits« Previous MessageNext Message »
From:eugene Date:April 24 2006 3:52pm
Subject:bk commit into 5.0 tree (evgen:1.2093)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen 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
  1.2093 06/04/24 17:52:15 evgen@stripped +3 -0
  Manually merged

  sql/share/errmsg.txt
    1.64 06/04/24 17:52:12 evgen@stripped +2 -2
    Manually merged

  sql/sql_select.cc
    1.408 06/04/24 17:49:32 evgen@stripped +0 -0
    Auto merged

  sql/item.cc
    1.216 06/04/24 17:49:31 evgen@stripped +0 -0
    Auto merged

# 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:	evgen
# Host:	moonbone.local
# Root:	/work/18739-bug-5.0-mysql/RESYNC

--- 1.215/sql/item.cc	2006-04-14 00:05:38 +04:00
+++ 1.216/sql/item.cc	2006-04-24 17:49:31 +04:00
@@ -3137,7 +3137,8 @@
     both clauses contain different fields with the same names, a warning is
     issued that name of 'ref' is ambiguous. We extend ANSI SQL in that when no
     GROUP BY column is found, then a HAVING name is resolved as a possibly
-    derived SELECT column.
+    derived SELECT column. This extension is allowed only if the
+    MODE_ONLY_FULL_GROUP_BY sql mode isn't enabled.
 
   NOTES
     The resolution procedure is:
@@ -3147,7 +3148,9 @@
       in the GROUP BY clause of Q.
     - If found different columns with the same name in GROUP BY and SELECT
       - issue a warning and return the GROUP BY column,
-      - otherwise return the found SELECT column.
+      - otherwise
+        - if the MODE_ONLY_FULL_GROUP_BY mode is enabled return error
+        - else return the found SELECT column.
 
 
   RETURN
@@ -3192,6 +3195,17 @@
     }
   }
 
+  if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY &&
+      select_ref != not_found_item && !group_by_ref)
+  {
+    /*
+      Report the error if fields was found only in the SELECT item list and
+      the strict mode is enabled.
+    */
+    my_error(ER_NON_GROUPING_FIELD_USED, MYF(0),
+             ref->name, "HAVING");
+    return NULL;
+  }
   if (select_ref != not_found_item || group_by_ref)
   {
     if (select_ref != not_found_item && !ambiguous_fields)

--- 1.407/sql/sql_select.cc	2006-04-21 10:28:57 +04:00
+++ 1.408/sql/sql_select.cc	2006-04-24 17:49:32 +04:00
@@ -12613,6 +12613,10 @@
       if (item->type() != Item::SUM_FUNC_ITEM && !item->marker &&
 	  !item->const_item())
       {
+        /*
+          TODO: change ER_WRONG_FIELD_WITH_GROUP to more detailed
+          ER_NON_GROUPING_FIELD_USED
+        */
 	my_error(ER_WRONG_FIELD_WITH_GROUP, MYF(0), item->full_name());
 	return 1;
       }

--- 1.63/sql/share/errmsg.txt	2006-04-14 00:12:22 +04:00
+++ 1.64/sql/share/errmsg.txt	2006-04-24 17:52:12 +04:00
@@ -5615,3 +5615,5 @@
         eng "Can't create more than max_prepared_stmt_count statements (current value:
%lu)"
 ER_VIEW_RECURSIVE
         eng "`%-.64s`.`%-.64s` contain view recursion"
+ER_NON_GROUPING_FIELD_USED 42000
+	eng "non-grouping field '%-.64s' is used in %-.64s clause"
Thread
bk commit into 5.0 tree (evgen:1.2093)eugene24 Apr