summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2006-11-06 17:13:19 -0500
committerunknown <cmiller@zippy.cornsilk.net>2006-11-06 17:13:19 -0500
commit2b35fee8ab4bce7c40b95cb6b3b3593bd0960546 (patch)
treebed54dd373e9401ad43610e0d42dddde20eb40d7 /sql/item_func.cc
parente1a722b2d3a428c650bf08527b8c9ed9bdbd3e08 (diff)
downloadmariadb-git-2b35fee8ab4bce7c40b95cb6b3b3593bd0960546.tar.gz
Bug#23411: ... MOD-ing zero returns strange result
The Item_func_mod objects never had maybe_null set, so users had no reason to expect that they can be NULL, and may therefore deduce wrong results. Now, set maybe_null. mysql-test/r/func_test.result: Verify that the predictions are true. mysql-test/t/func_test.test: Verify that the predictions are true. sql/item_func.cc: MOD functions may be NULL.
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 1af49179aee..117ae19137b 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -96,7 +96,7 @@ Item_func::Item_func(THD *thd, Item_func *item)
/*
- Resolve references to table column for a function and it's argument
+ Resolve references to table column for a function and its argument
SYNOPSIS:
fix_fields()
@@ -707,6 +707,7 @@ longlong Item_func_mod::val_int()
void Item_func_mod::fix_length_and_dec()
{
Item_num_op::fix_length_and_dec();
+ maybe_null= 1;
}