Below is the list of changes that have just been committed into a local
5.1 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 16:00:15+04:00, kaa@stripped +12 -0
Merge polly.local:/tmp/20924/bug20294/my50-bug20294
into polly.local:/tmp/20924/bug20294/my51-bug20294
MERGE: 1.1810.2066.5
mysql-test/r/case.result@stripped, 2006-09-13 15:19:53+04:00, kaa@stripped +0 -0
Auto merged
MERGE: 1.24.2.4
mysql-test/r/func_if.result@stripped, 2006-09-13 15:19:53+04:00, kaa@stripped +0 -0
Auto merged
MERGE: 1.21.1.2
mysql-test/r/func_test.result@stripped, 2006-09-13 15:19:53+04:00, kaa@stripped +0 -0
Auto merged
MERGE: 1.29.1.2
mysql-test/r/user_var.result@stripped, 2006-09-13 16:00:12+04:00, kaa@stripped +0 -1
Manual merge
MERGE: 1.37.2.2
mysql-test/t/case.test@stripped, 2006-09-13 15:19:53+04:00, kaa@stripped +0 -0
Auto merged
MERGE: 1.18.1.3
mysql-test/t/user_var.test@stripped, 2006-09-13 16:00:12+04:00, kaa@stripped +1 -2
Manual merge
MERGE: 1.33.1.2
sql/item_cmpfunc.cc@stripped, 2006-09-13 15:19:53+04:00, kaa@stripped +0 -0
Auto merged
MERGE: 1.187.6.2
sql/item_cmpfunc.h@stripped, 2006-09-13 15:19:53+04:00, kaa@stripped +0 -0
Auto merged
MERGE: 1.122.3.2
sql/item_func.cc@stripped, 2006-09-13 16:00:12+04:00, kaa@stripped +1 -1
Manual merge
MERGE: 1.270.19.3
sql/item_func.h@stripped, 2006-09-13 16:00:12+04:00, kaa@stripped +0 -0
Manual merge
MERGE: 1.136.13.2
sql/log_event.cc@stripped, 2006-09-13 15:19:54+04:00, kaa@stripped +0 -0
Auto merged
MERGE: 1.174.1.36
sql/sql_class.h@stripped, 2006-09-13 15:19:54+04:00, kaa@stripped +0 -0
Auto merged
MERGE: 1.230.27.10
# 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/my51-bug20294/RESYNC
--- 1.217/sql/item_cmpfunc.cc 2006-09-13 16:00:21 +04:00
+++ 1.218/sql/item_cmpfunc.cc 2006-09-13 16:00:21 +04:00
@@ -745,7 +745,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;
@@ -766,7 +770,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;
@@ -1407,13 +1417,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;
}
@@ -1564,7 +1572,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;
}
@@ -1813,7 +1820,6 @@ longlong Item_func_case::val_int()
}
res=item->val_int();
null_value=item->null_value;
- unsigned_flag= item->unsigned_flag;
return res;
}
@@ -2000,10 +2006,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.130/sql/item_cmpfunc.h 2006-09-13 16:00:21 +04:00
+++ 1.131/sql/item_cmpfunc.h 2006-09-13 16:00:21 +04:00
@@ -1411,17 +1411,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.312/sql/item_func.cc 2006-09-13 16:00:21 +04:00
+++ 1.313/sql/item_func.cc 2006-09-13 16:00:21 +04:00
@@ -2169,33 +2169,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;
}
@@ -3459,7 +3444,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:
@@ -3603,7 +3587,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;
@@ -3836,13 +3819,13 @@ 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,
+ INT_RESULT, &my_charset_bin, DERIVATION_IMPLICIT,
unsigned_flag);
break;
}
@@ -3850,12 +3833,12 @@ Item_func_set_user_var::update()
{
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.238/sql/log_event.cc 2006-09-13 16:00:21 +04:00
+++ 1.239/sql/log_event.cc 2006-09-13 16:00:21 +04:00
@@ -3923,7 +3923,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.317/sql/sql_class.h 2006-09-13 16:00:21 +04:00
+++ 1.318/sql/sql_class.h 2006-09-13 16:00:21 +04:00
@@ -2018,7 +2018,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.31/mysql-test/r/case.result 2006-09-13 16:00:21 +04:00
+++ 1.32/mysql-test/r/case.result 2006-09-13 16:00:21 +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.31/mysql-test/r/func_test.result 2006-09-13 16:00:21 +04:00
+++ 1.32/mysql-test/r/func_test.result 2006-09-13 16:00:21 +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.21/mysql-test/t/case.test 2006-09-13 16:00:21 +04:00
+++ 1.22/mysql-test/t/case.test 2006-09-13 16:00:21 +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.23/mysql-test/r/func_if.result 2006-09-13 16:00:21 +04:00
+++ 1.24/mysql-test/r/func_if.result 2006-09-13 16:00:21 +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.42/mysql-test/r/user_var.result 2006-09-13 16:00:21 +04:00
+++ 1.43/mysql-test/r/user_var.result 2006-09-13 16:00:21 +04:00
@@ -301,4 +301,3 @@ select @var;
@var
3
drop table t1;
-End of 4.1 tests
--- 1.36/mysql-test/t/user_var.test 2006-09-13 16:00:21 +04:00
+++ 1.37/mysql-test/t/user_var.test 2006-09-13 16:00:21 +04:00
@@ -144,7 +144,6 @@ select @@version;
--replace_column 1 #
select @@global.version;
-#
# Bug #6598: problem with cast(NULL as signed integer);
#
@@ -211,4 +210,4 @@ select @var:=f2 from t1 group by f1 orde
select @var;
drop table t1;
---echo End of 4.1 tests
+# End of 4.1 tests
| Thread |
|---|
| • bk commit into 5.1 tree (kaa:1.2355) | Alexey Kopytov | 13 Sep |