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() and Item_func_neg::decimal_op()
  now return 0 if NULL.
  Trivial optimization - get rid of an extra jump for common situations.
This commit is contained in:
unknown
2005-05-19 13:35:13 +05:00
parent c4840884d9
commit c1ed128f66
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);