mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge with 4.1
BitKeeper/etc/logging_ok: auto-union configure.in: Auto merged include/config-win.h: Auto merged include/my_global.h: Auto merged mysql-test/r/drop.result: Auto merged mysys/default.c: Auto merged mysys/mf_keycache.c: Auto merged sql/field.h: Auto merged sql/item.h: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/mysqld.cc: Auto merged BitKeeper/deleted/.del-errmsg.txt~f96b7055cac394e: Auto merged mysql-test/r/cast.result: Merge mysql-test/t/cast.test: Merge sql/sql_insert.cc: Merge sql/sql_select.cc: Merge
This commit is contained in:
@ -4,7 +4,6 @@
|
||||
|
||||
select CAST(1-2 AS UNSIGNED);
|
||||
select CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER);
|
||||
select CONVERT('-1',UNSIGNED);
|
||||
select CAST('10 ' as unsigned integer);
|
||||
select cast(-5 as unsigned) | 1, cast(-5 as unsigned) & -1;
|
||||
select cast(-5 as unsigned) -1, cast(-5 as unsigned) + 1;
|
||||
@ -34,6 +33,15 @@ select 10+'a';
|
||||
select 10.0+cast('a' as decimal);
|
||||
select 10E+0+'a';
|
||||
|
||||
# out-of-range cases
|
||||
select cast('18446744073709551616' as unsigned);
|
||||
select cast('18446744073709551616' as signed);
|
||||
select cast('9223372036854775809' as signed);
|
||||
select cast('-1' as unsigned);
|
||||
select cast('abc' as signed);
|
||||
select cast('1a' as signed);
|
||||
select cast('' as signed);
|
||||
|
||||
#
|
||||
# Character set convertion
|
||||
#
|
||||
@ -132,6 +140,22 @@ select timediff(cast('2004-12-30 12:00:00' as time), '12:00:00');
|
||||
# Still we should not throw away "days" part of time value
|
||||
select timediff(cast('1 12:00:00' as time), '12:00:00');
|
||||
|
||||
#
|
||||
# Bug #7036: Casting from string to unsigned would cap value of result at
|
||||
# maximum signed value instead of maximum unsigned value
|
||||
#
|
||||
select cast(18446744073709551615 as unsigned);
|
||||
select cast(18446744073709551615 as signed);
|
||||
select cast('18446744073709551615' as unsigned);
|
||||
select cast('18446744073709551615' as signed);
|
||||
select cast('9223372036854775807' as signed);
|
||||
|
||||
select cast(concat('184467440','73709551615') as unsigned);
|
||||
select cast(concat('184467440','73709551615') as signed);
|
||||
|
||||
select cast(repeat('1',20) as unsigned);
|
||||
select cast(repeat('1',20) as signed);
|
||||
|
||||
#decimal-related additions
|
||||
select cast('1.2' as decimal(3,2));
|
||||
select 1e18 * cast('1.2' as decimal(3,2));
|
||||
|
Reference in New Issue
Block a user