1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Fix for bug #10337 (cast(NULL DECIMAL) crashes the server)

mysql-test/r/cast.result:
  test result fixed
mysql-test/t/cast.test:
  test case added
sql/item_func.cc:
  checks for NULL added
strings/decimal.c:
  we need to return specified 'scale' for the rounded decimal
This commit is contained in:
unknown
2005-06-15 19:02:35 +05:00
parent b0df449452
commit e4cdb19387
4 changed files with 24 additions and 2 deletions

View File

@ -344,3 +344,6 @@ select cast(s1 as decimal(7,2)) from t1;
cast(s1 as decimal(7,2))
111111.00
drop table t1;
select cast(NULL as decimal(6)) as t1;
t1
NULL

View File

@ -168,3 +168,9 @@ create table t1(s1 time);
insert into t1 values ('11:11:11');
select cast(s1 as decimal(7,2)) from t1;
drop table t1;
#
# Bug @10237 (CAST(NULL DECIMAL) crashes server)
#
select cast(NULL as decimal(6)) as t1;