summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2004-05-05 20:04:25 +0400
committerunknown <sergefp@mysql.com>2004-05-05 20:04:25 +0400
commite1fc542382faac3c1c19b82db7ad28849d5d0658 (patch)
tree00e01c4d1651e5b8f974e572b3b707db9557df9c /sql/item.cc
parent393ed84c9a0cd98479aa8bf8c4de1236740639ea (diff)
downloadmariadb-git-e1fc542382faac3c1c19b82db7ad28849d5d0658.tar.gz
Make Item_param::val_int and Item_param::val_str follow the used convention and return 0 if null_value==1.
sql/item.h: Added comments about Item::valxx() behavior if Item's value is NULL.
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc
index e1cdfcf42c0..963f97b059f 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -745,6 +745,8 @@ double Item_param::val()
{
DBUG_ASSERT(value_is_set == 1);
int err;
+ if (null_value)
+ return 0.0;
switch (item_result_type) {
case STRING_RESULT:
return (double) my_strntod(str_value.charset(), (char*) str_value.ptr(),
@@ -761,6 +763,8 @@ longlong Item_param::val_int()
{
DBUG_ASSERT(value_is_set == 1);
int err;
+ if (null_value)
+ return 0;
switch (item_result_type) {
case STRING_RESULT:
return my_strntoll(str_value.charset(),