1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge polly.local:/tmp/20924/bug20294/my41-bug20294

into  polly.local:/home/kaa/src/maint/m41-maint--07OGk


sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.h:
  Auto merged
sql/sql_class.h:
  Auto merged
This commit is contained in:
unknown
2006-09-12 19:28:57 +04:00
14 changed files with 126 additions and 28 deletions

View File

@ -177,3 +177,10 @@ from t1 where b=3 group by b;
min(a) min(case when 1=1 then a else NULL end) min(case when 1!=1 then NULL else a end)
2 2 2
drop table t1;
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

View File

@ -99,3 +99,10 @@ a NULLIF(a,'')
NULL NULL
NULL
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

View File

@ -183,3 +183,10 @@ select 5.1 mod 3, 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;
5 mod 3 5 mod -3 -5 mod 3 -5 mod -3
2 2 -2 -2
SELECT GREATEST(1, 18446744073709551615);
GREATEST(1, 18446744073709551615)
18446744073709551615
SELECT LEAST(1, 18446744073709551615);
LEAST(1, 18446744073709551615)
1
End of 4.1 tests

View File

@ -203,3 +203,8 @@ select @@global.version;
select @@session.VERSION;
@@session.VERSION
#
set @a=18446744073709551615;
select @a;
@a
18446744073709551615
End of 4.1 tests

View File

@ -130,4 +130,12 @@ select min(a), min(case when 1=1 then a else NULL end),
from t1 where b=3 group by b;
drop table t1;
# End of 4.1 tests
#
# 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

View File

@ -73,4 +73,18 @@ SELECT a, NULLIF(a,'') FROM t1 WHERE NULLIF(a,'') IS NULL;
DROP TABLE t1;
# End of 4.1 tests
#
# 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

View File

@ -108,4 +108,12 @@ select 5.1 mod 3, 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;
# End of 4.1 tests
#
# 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

View File

@ -141,4 +141,12 @@ select @@global.version;
--replace_column 1 #
select @@session.VERSION;
# End of 4.1 tests
#
# 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