List:Commits« Previous MessageNext Message »
From:Alexey Kopytov Date:September 13 2006 11:18am
Subject:bk commit into 5.0 tree (kaa:1.2234)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of kaa. When kaa 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, 2006-09-13 15:18:14+04:00, kaa@stripped +14 -0
  Merge polly.local:/tmp/20924/bug20294/my41-bug20294
  into  polly.local:/tmp/20924/bug20294/my50-bug20294
  MERGE: 1.1616.2658.19

  mysql-test/r/case.result@stripped, 2006-09-13 15:18:12+04:00, kaa@stripped +0 -7
    Manual merge
    MERGE: 1.14.1.6

  mysql-test/r/func_if.result@stripped, 2006-09-13 15:18:12+04:00, kaa@stripped +0 -7
    Manual merge
    MERGE: 1.11.1.7

  mysql-test/r/func_test.result@stripped, 2006-09-13 15:18:12+04:00, kaa@stripped +0 -7
    Manual merge
    MERGE: 1.20.2.4

  mysql-test/r/user_var.result@stripped, 2006-09-13 15:18:12+04:00, kaa@stripped +0 -5
    Manual merge
    MERGE: 1.14.2.14

  mysql-test/t/case.test@stripped, 2006-09-13 15:18:12+04:00, kaa@stripped +1 -9
    Manual merge
    MERGE: 1.14.1.6

  mysql-test/t/func_if.test@stripped, 2006-09-13 15:18:12+04:00, kaa@stripped +0 -15
    Manual merge
    MERGE: 1.10.1.8

  mysql-test/t/func_test.test@stripped, 2006-09-13 15:18:12+04:00, kaa@stripped +1 -9
    Manual merge
    MERGE: 1.22.1.4

  mysql-test/t/user_var.test@stripped, 2006-09-13 15:18:12+04:00, kaa@stripped +1 -8
    Manual merge
    MERGE: 1.13.1.12

  sql/item_cmpfunc.cc@stripped, 2006-09-13 14:43:44+04:00, kaa@stripped +0 -0
    Auto merged
    MERGE: 1.111.23.11

  sql/item_cmpfunc.h@stripped, 2006-09-13 14:43:44+04:00, kaa@stripped +0 -0
    Auto merged
    MERGE: 1.73.1.45

  sql/item_func.cc@stripped, 2006-09-13 15:18:12+04:00, kaa@stripped +2 -5
    Manual merge
    MERGE: 1.124.42.13

  sql/item_func.h@stripped, 2006-09-13 14:43:45+04:00, kaa@stripped +0 -0
    Auto merged
    MERGE: 1.68.1.65

  sql/log_event.cc@stripped, 2006-09-13 14:43:45+04:00, kaa@stripped +0 -0
    Auto merged
    MERGE: 1.113.1.77

  sql/sql_class.h@stripped, 2006-09-13 14:43:45+04:00, kaa@stripped +0 -0
    Auto merged
    MERGE: 1.146.57.2

# 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:	kaa
# Host:	polly.local
# Root:	/tmp/20924/bug20294/my50-bug20294/RESYNC

--- 1.213/sql/item_cmpfunc.cc	2006-09-13 15:18:20 +04:00
+++ 1.214/sql/item_cmpfunc.cc	2006-09-13 15:18:20 +04:00
@@ -719,7 +719,11 @@ int Arg_comparator::compare_int_signed_u
     if (!(*b)->null_value)
     {
       owner->null_value= 0;
-      return ::compare_int_signed_unsigned(sval1, uval2);
+      if (sval1 < 0 || (ulonglong)sval1 < uval2)
+        return -1;
+      if ((ulonglong)sval1 == uval2)
+        return 0;
+      return 1;
     }
   }
   owner->null_value= 1;
@@ -740,7 +744,13 @@ int Arg_comparator::compare_int_unsigned
     if (!(*b)->null_value)
     {
       owner->null_value= 0;
-      return ::compare_int_unsigned_signed(uval1, sval2);
+      if (sval2 < 0)
+        return 1;
+      if (uval1 < (ulonglong)sval2)
+        return -1;
+      if (uval1 == (ulonglong)sval2)
+        return 0;
+      return 1;
     }
   }
   owner->null_value= 1;
@@ -1380,13 +1390,11 @@ Item_func_ifnull::int_op()
   if (!args[0]->null_value)
   {
     null_value=0;
-    unsigned_flag= args[0]->unsigned_flag;
     return value;
   }
   value=args[1]->val_int();
   if ((null_value=args[1]->null_value))
     return 0;
-  unsigned_flag= args[1]->unsigned_flag;
   return value;
 }
 
@@ -1537,7 +1545,6 @@ Item_func_if::val_int()
   Item *arg= args[0]->val_bool() ? args[1] : args[2];
   longlong value=arg->val_int();
   null_value=arg->null_value;
-  unsigned_flag= arg->unsigned_flag;
   return value;
 }
 
@@ -1786,7 +1793,6 @@ longlong Item_func_case::val_int()
   }
   res=item->val_int();
   null_value=item->null_value;
-  unsigned_flag= item->unsigned_flag;
   return res;
 }
 
@@ -1973,10 +1979,7 @@ longlong Item_func_coalesce::int_op()
   {
     longlong res=args[i]->val_int();
     if (!args[i]->null_value)
-    {
-      unsigned_flag= args[i]->unsigned_flag;  
       return res;
-    }
   }
   null_value=1;
   return 0;

--- 1.129/sql/item_cmpfunc.h	2006-09-13 15:18:20 +04:00
+++ 1.130/sql/item_cmpfunc.h	2006-09-13 15:18:20 +04:00
@@ -1394,17 +1394,3 @@ inline Item *and_conds(Item *a, Item *b)
 }
 
 Item *and_expressions(Item *a, Item *b, Item **org_item);
-
-inline int compare_int_signed_unsigned(longlong sval, ulonglong uval)
-{
-  if (sval < 0 || (ulonglong)sval < uval)
-    return -1;
-  if ((ulonglong)sval == uval)
-    return 0;
-  return 1;
-}
-
-inline int compare_int_unsigned_signed(ulonglong uval, longlong sval)
-{
-  return -compare_int_signed_unsigned(sval, uval);
-}

--- 1.295/sql/item_func.cc	2006-09-13 15:18:20 +04:00
+++ 1.296/sql/item_func.cc	2006-09-13 15:18:20 +04:00
@@ -2136,33 +2136,18 @@ longlong Item_func_min_max::val_int()
 {
   DBUG_ASSERT(fixed == 1);
   longlong value=0;
-  my_bool arg_unsigned_flag;
-  my_bool cmp;
   for (uint i=0; i < arg_count ; i++)
   {
-    longlong tmp= args[i]->val_int();
-    if ((null_value= args[i]->null_value))
-      break;
-    arg_unsigned_flag= args[i]->unsigned_flag;
     if (i == 0)
-    {
-      value= tmp;
-      unsigned_flag= arg_unsigned_flag;
-    }
+      value=args[i]->val_int();
     else
     {
-      if (unsigned_flag == arg_unsigned_flag)
-        cmp= tmp < value;
-      else if (unsigned_flag)
-        cmp= compare_int_signed_unsigned(tmp, value) < 0;
-      else
-        cmp= compare_int_unsigned_signed(tmp, value) < 0;
-      if ((cmp ? cmp_sign : -cmp_sign) > 0)
-      {
-        value= tmp;
-        unsigned_flag= arg_unsigned_flag;
-      }
+      longlong tmp=args[i]->val_int();
+      if (!args[i]->null_value && (tmp < value ? cmp_sign : -cmp_sign) > 0)
+	value=tmp;
     }
+    if ((null_value= args[i]->null_value))
+      break;
   }
   return value;
 }
@@ -3421,7 +3406,6 @@ static user_var_entry *get_variable(HASH
     entry->length=0;
     entry->update_query_id=0;
     entry->collation.set(NULL, DERIVATION_IMPLICIT);
-    entry->unsigned_flag= 0;
     /*
       If we are here, we were called from a SET or a query which sets a
       variable. Imagine it is this:
@@ -3565,7 +3549,6 @@ update_hash(user_var_entry *entry, bool 
       ((my_decimal*)entry->value)->fix_buffer_pointer();
     entry->length= length;
     entry->collation.set(cs, dv);
-    entry->unsigned_flag= unsigned_arg;
   }
   entry->type=type;
   return 0;
@@ -3740,7 +3723,6 @@ Item_func_set_user_var::check()
   case INT_RESULT:
   {
     save_result.vint= args[0]->val_int();
-    unsigned_flag= args[0]->unsigned_flag;
     break;
   }
   case STRING_RESULT:
@@ -3790,26 +3772,25 @@ Item_func_set_user_var::update()
   case REAL_RESULT:
   {
     res= update_hash((void*) &save_result.vreal,sizeof(save_result.vreal),
-		     REAL_RESULT, &my_charset_bin, DERIVATION_IMPLICIT, 0);
+		     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_IMPLICIT,
-                     unsigned_flag);
+		     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_IMPLICIT, 0);
+		       DERIVATION_IMPLICIT);
     else
       res= update_hash((void*) save_result.vstr->ptr(),
 		       save_result.vstr->length(), STRING_RESULT,
 		       save_result.vstr->charset(),
-		       DERIVATION_IMPLICIT, 0);
+		       DERIVATION_IMPLICIT);
     break;
   }
   case DECIMAL_RESULT:

--- 1.143/sql/item_func.h	2006-09-13 15:18:20 +04:00
+++ 1.144/sql/item_func.h	2006-09-13 15:18:20 +04:00
@@ -1170,7 +1170,7 @@ public:
   String *val_str(String *str);
   my_decimal *val_decimal(my_decimal *);
   bool update_hash(void *ptr, uint length, enum Item_result type, 
-  		   CHARSET_INFO *cs, Derivation dv, bool unsigned_arg);
+  		   CHARSET_INFO *cs, Derivation dv);
   bool check();
   bool update();
   enum Item_result result_type () const { return cached_result_type; }

--- 1.209/sql/log_event.cc	2006-09-13 15:18:20 +04:00
+++ 1.210/sql/log_event.cc	2006-09-13 15:18:20 +04:00
@@ -3846,7 +3846,7 @@ int User_var_log_event::exec_event(struc
     a single record and with a single column. Thus, like
     a column value, it could always have IMPLICIT derivation.
    */
-  e.update_hash(val, val_len, type, charset, DERIVATION_IMPLICIT, 0);
+  e.update_hash(val, val_len, type, charset, DERIVATION_IMPLICIT);
   free_root(thd->mem_root,0);
 
   rli->inc_event_relay_log_pos();

--- 1.297/sql/sql_class.h	2006-09-13 15:18:20 +04:00
+++ 1.298/sql/sql_class.h	2006-09-13 15:18:20 +04:00
@@ -2015,7 +2015,6 @@ class user_var_entry
   ulong length;
   query_id_t update_query_id, used_query_id;
   Item_result type;
-  bool unsigned_flag;
 
   double val_real(my_bool *null_value);
   longlong val_int(my_bool *null_value);

--- 1.27/mysql-test/r/case.result	2006-09-13 15:18:20 +04:00
+++ 1.28/mysql-test/r/case.result	2006-09-13 15:18:20 +04:00
@@ -200,10 +200,3 @@ CEMPNUM	EMPMUM1	EMPNUM2
 0.00	0	0.00
 2.00	2	NULL
 DROP TABLE t1,t2;
-SELECT CASE 1 WHEN 1 THEN 18446744073709551615 ELSE 1 END;
-CASE 1 WHEN 1 THEN 18446744073709551615 ELSE 1 END
-18446744073709551615
-SELECT COALESCE(18446744073709551615);
-COALESCE(18446744073709551615)
-18446744073709551615
-End of 4.1 tests

--- 1.30/mysql-test/r/func_test.result	2006-09-13 15:18:20 +04:00
+++ 1.31/mysql-test/r/func_test.result	2006-09-13 15:18:20 +04:00
@@ -204,10 +204,3 @@ NULL
 SELECT GREATEST(1.5E+2,1.3E+2,NULL) FROM DUAL;
 GREATEST(1.5E+2,1.3E+2,NULL)
 NULL
-SELECT GREATEST(1, 18446744073709551615);
-GREATEST(1, 18446744073709551615)
-18446744073709551615
-SELECT LEAST(1, 18446744073709551615);
-LEAST(1, 18446744073709551615)
-1
-End of 4.1 tests

--- 1.20/mysql-test/t/case.test	2006-09-13 15:18:20 +04:00
+++ 1.21/mysql-test/t/case.test	2006-09-13 15:18:20 +04:00
@@ -152,12 +152,4 @@ SELECT IFNULL(t2.EMPNUM,t1.EMPNUM) AS CE
   FROM t1 LEFT JOIN t2 ON t1.EMPNUM=t2.EMPNUM;
 
 DROP TABLE t1,t2;
-#
-# Bug #20924: CAST(expr as UNSIGNED) returns SIGNED value when used in various
-# functions
-# - UNSIGNED values in CASE and COALESCE are treated as SIGNED
-#
-SELECT CASE 1 WHEN 1 THEN 18446744073709551615 ELSE 1 END;
-SELECT COALESCE(18446744073709551615);
-
---echo End of 4.1 tests
+# End of 4.1 tests

--- 1.26/mysql-test/t/func_test.test	2006-09-13 15:18:20 +04:00
+++ 1.27/mysql-test/t/func_test.test	2006-09-13 15:18:20 +04:00
@@ -108,7 +108,6 @@ select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3
 
 select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3;
 
-#
 # Bug#6726: NOT BETWEEN parse failure
 #
 create table t1 (a int, b int);
@@ -126,12 +125,4 @@ SELECT LEAST('xxx','aaa',NULL,'yyy') FRO
 SELECT LEAST(1.1,1.2,NULL,1.0) FROM DUAL;
 SELECT GREATEST(1.5E+2,1.3E+2,NULL) FROM DUAL;
 
-#
-# Bug #20924: CAST(expr as UNSIGNED) returns SIGNED value when used in various
-# functions
-# - UNSIGNED values in GREATEST() and LEAST() are treated as SIGNED
-#
-SELECT GREATEST(1, 18446744073709551615);
-SELECT LEAST(1, 18446744073709551615);
-
---echo End of 4.1 tests
+# End of 4.1 tests

--- 1.22/mysql-test/r/func_if.result	2006-09-13 15:18:20 +04:00
+++ 1.23/mysql-test/r/func_if.result	2006-09-13 15:18:20 +04:00
@@ -128,10 +128,3 @@ f1	f2	if(f1, 40.0, 5.00)
 0	0	5.00
 1	1	40.00
 drop table t1;
-SELECT IF(1 != 0, 18446744073709551615, 1);
-IF(1 != 0, 18446744073709551615, 1)
-18446744073709551615
-SELECT IFNULL(NULL, 18446744073709551615);
-IFNULL(NULL, 18446744073709551615)
-18446744073709551615
-End of 4.1 tests

--- 1.20/mysql-test/t/func_if.test	2006-09-13 15:18:20 +04:00
+++ 1.21/mysql-test/t/func_if.test	2006-09-13 15:18:20 +04:00
@@ -97,18 +97,3 @@ create table t1 (f1 int, f2 int);
 insert into t1 values(1,1),(0,0);
 select f1, f2, if(f1, 40.0, 5.00) from t1 group by f1 order by f2;
 drop table t1;
-#
-# Bug #20924: CAST(expr as UNSIGNED) returns SIGNED value when used in various
-# functions
-# - UNSIGNED values in IF() are treated as SIGNED
-#
-SELECT IF(1 != 0, 18446744073709551615, 1);
-
-#
-# Bug #20924: CAST(expr as UNSIGNED) returns SIGNED value when used in various
-# functions
-# - UNSIGNED values in IFNULL() are treated as SIGNED
-#
-SELECT IFNULL(NULL, 18446744073709551615);
-
---echo End of 4.1 tests

--- 1.39/mysql-test/r/user_var.result	2006-09-13 15:18:20 +04:00
+++ 1.40/mysql-test/r/user_var.result	2006-09-13 15:18:20 +04:00
@@ -256,8 +256,3 @@ t1	CREATE TABLE `t1` (
   `@first_var` longtext
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1;
-set @a=18446744073709551615;
-select @a;
-@a
-18446744073709551615
-End of 4.1 tests

--- 1.34/mysql-test/t/user_var.test	2006-09-13 15:18:20 +04:00
+++ 1.35/mysql-test/t/user_var.test	2006-09-13 15:18:20 +04:00
@@ -144,7 +144,6 @@ select @@version;
 --replace_column 1 #
 select @@global.version;
 
-#
 # Bug #6598: problem with cast(NULL as signed integer);
 #
 
@@ -169,12 +168,5 @@ set @first_var= cast(NULL as CHAR);
 create table t1 select @first_var;
 show create table t1;
 drop table t1;
-#
-# Bug #20924: CAST(expr as UNSIGNED) returns SIGNED value when used in various
-# functions
-# - SET on a user variable saves UNSIGNED as SIGNED
-#
-set @a=18446744073709551615;
-select @a;
 
---echo End of 4.1 tests
+# End of 4.1 tests
Thread
bk commit into 5.0 tree (kaa:1.2234)Alexey Kopytov13 Sep