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:
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user