List:Internals« Previous MessageNext Message »
From:bar Date:March 28 2005 9:02am
Subject:bk commit into 4.1 tree (bar:1.2149) BUG#9425
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of bar. When bar 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.2149 05/03/28 14:01:57 bar@stripped +3 -0
  Bug#9425 A user variable doesn't always have implicit coercibility
  Coercibility fixes for numeric types and not defined values were done.

  sql/item_func.cc
    1.238 05/03/28 14:01:53 bar@stripped +6 -3
    Bug#9425 A user variable doesn't always have implicit coercibility
    Coercibility fixes for numeric types and not defined values were done.

  mysql-test/t/user_var.test
    1.18 05/03/28 14:01:53 bar@stripped +7 -0
    Bug#9425 A user variable doesn't always have implicit coercibility
    Coercibility fixes for numeric types and not defined values were done.

  mysql-test/r/user_var.result
    1.25 05/03/28 14:01:53 bar@stripped +7 -0
    Bug#9425 A user variable doesn't always have implicit coercibility
    Coercibility fixes for numeric types and not defined values were done.

# 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:	bar
# Host:	bar.intranet.mysql.r18.ru
# Root:	/usr/home/bar/mysql-4.1

--- 1.237/sql/item_func.cc	2005-03-16 16:52:30 +04:00
+++ 1.238/sql/item_func.cc	2005-03-28 14:01:53 +05:00
@@ -2634,20 +2634,20 @@
   case REAL_RESULT:
   {
     res= update_hash((void*) &save_result.vreal,sizeof(save_result.vreal),
-		     REAL_RESULT, &my_charset_bin, DERIVATION_NONE);
+		     REAL_RESULT, &my_charset_bin, DERIVATION_IMPLICIT);
     break;
   }
   case INT_RESULT:
   {
     res= update_hash((void*) &save_result.vint, sizeof(save_result.vint),
-		     INT_RESULT, &my_charset_bin, DERIVATION_NONE);
+		     INT_RESULT, &my_charset_bin, DERIVATION_IMPLICIT);
     break;
   }
   case STRING_RESULT:
   {
     if (!save_result.vstr)					// Null value
       res= update_hash((void*) 0, 0, STRING_RESULT, &my_charset_bin,
-		       DERIVATION_NONE);
+		       DERIVATION_IMPLICIT);
     else
       res= update_hash((void*) save_result.vstr->ptr(),
 		       save_result.vstr->length(), STRING_RESULT,
@@ -2870,7 +2870,10 @@
     }
   }
   else
+  {
+    collation.set(&my_charset_bin, DERIVATION_IMPLICIT);
     null_value= 1;
+  }
 
   if (error)
     thd->fatal_error();

--- 1.24/mysql-test/r/user_var.result	2005-02-22 15:55:33 +04:00
+++ 1.25/mysql-test/r/user_var.result	2005-03-28 14:01:53 +05:00
@@ -193,3 +193,10 @@
 select FIELD( @var,'1it','Hit') as my_column;
 my_column
 0
+select @v, coercibility(@v);
+@v	coercibility(@v)
+NULL	2
+set @v1=null, @v2=1, @v3=1.1, @v4=now();
+select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
+coercibility(@v1)	coercibility(@v2)	coercibility(@v3)	coercibility(@v4)
+2	2	2	2

--- 1.17/mysql-test/t/user_var.test	2005-02-22 15:55:33 +04:00
+++ 1.18/mysql-test/t/user_var.test	2005-03-28 14:01:53 +05:00
@@ -122,3 +122,10 @@
 #
 set @var= NULL ;
 select FIELD( @var,'1it','Hit') as my_column;
+
+#
+# Bug#9425 A user variable doesn't always have implicit coercibility
+#
+select @v, coercibility(@v);
+set @v1=null, @v2=1, @v3=1.1, @v4=now();
+select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
Thread
bk commit into 4.1 tree (bar:1.2149) BUG#9425bar28 Mar