1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

a fix (bug #10599: Numeric function 'abs' make server crash).

sql/item_func.cc:
  a fix (bug #10599: Numeric function 'abs' make server crash).
  Item_func_abs::decimal_op() now returns 0 if NULL.                              
  trivial optimization - get rid of an extra jump for common situations.          
  fixed Item_func_neg::decimal_op() return value if NULL.
This commit is contained in:
unknown
2005-05-19 17:59:14 +05:00
parent 44819149ad
commit 4387f4d967
3 changed files with 47 additions and 32 deletions

View File

@ -885,3 +885,9 @@ SELECT GRADE FROM t1 WHERE GRADE= 151;
GRADE
151
DROP TABLE t1;
select abs(10/0);
abs(10/0)
NULL
select abs(NULL);
abs(NULL)
NULL

View File

@ -916,3 +916,10 @@ INSERT INTO t1 (GRADE) VALUES (151),(252),(343);
SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300;
SELECT GRADE FROM t1 WHERE GRADE= 151;
DROP TABLE t1;
#
# Bug #10599: problem with NULL
#
select abs(10/0);
select abs(NULL);