List:Internals« Previous MessageNext Message »
From:holyfoot Date:June 14 2005 2:43pm
Subject:bk commit into 5.0 tree (hf:1.1925) BUG#11314
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of hf. When hf 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.1925 05/06/14 17:43:51 hf@deer.(none) +2 -0
  Fix for bug #11314 (HAVING DEFAULT() hangs)

  sql/item.cc
    1.135 05/06/14 17:42:47 hf@deer.(none) +6 -8
    code simplified using real_item() method,
    error returning added

  mysql-test/t/func_default.test
    1.3 05/06/14 17:42:47 hf@deer.(none) +10 -1
    test result fixed

# 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:	hf
# Host:	deer.(none)
# Root:	/home/hf/work/mysql-5.0.clean

--- 1.134/sql/item.cc	Tue Jun  7 07:43:54 2005
+++ 1.135/sql/item.cc	Tue Jun 14 17:42:47 2005
@@ -4454,16 +4454,14 @@
   }
   if (!arg->fixed && arg->fix_fields(thd, table_list, &arg))
     return TRUE;
-  
-  if (arg->type() == REF_ITEM)
+
+  arg= arg->real_item();
+  if (arg->type() != FIELD_ITEM)
   {
-    Item_ref *ref= (Item_ref *)arg;
-    if (ref->ref[0]->type() != FIELD_ITEM)
-    {
-      return TRUE;
-    }
-    arg= ref->ref[0];
+    my_error(ER_NO_DEFAULT_FOR_FIELD, MYF(0), arg->name);
+    return TRUE;
   }
+
   field_arg= (Item_field *)arg;
   if (field_arg->field->flags & NO_DEFAULT_VALUE_FLAG)
   {

--- 1.2/mysql-test/t/func_default.test	Sat Mar 20 14:29:41 2004
+++ 1.3/mysql-test/t/func_default.test	Tue Jun 14 17:42:47 2005
@@ -16,4 +16,13 @@
 #show create table from t1;
 #insert into t2 select select default(str), default(strnull), default(intg), default(rel) from t1;
 
-drop table t1;
\ No newline at end of file
+drop table t1;
+
+#
+# Bug #11314 (HAVING DEFAULT() hangs)
+#
+CREATE TABLE t1 (s varchar(20), id int(11));
+INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three');
+SELECT s, 32 AS mi FROM t1 GROUP BY s HAVING DEFAULT(mi) IS NULL;
+DROP TABLE t1;
+
Thread
bk commit into 5.0 tree (hf:1.1925) BUG#11314holyfoot14 Jun