summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2004-05-06 01:06:18 +0400
committerunknown <sergefp@mysql.com>2004-05-06 01:06:18 +0400
commitcd57fc8bdabbd3b1b44fa98ae1c3bc7c66fcd08c (patch)
treeaeac96ac231c6580ff7e3197287a2b8269a1c21e
parent1f32e9a19985554a0e79f16b349f7afcc0dbbe57 (diff)
parente1fc542382faac3c1c19b82db7ad28849d5d0658 (diff)
downloadmariadb-git-cd57fc8bdabbd3b1b44fa98ae1c3bc7c66fcd08c.tar.gz
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/dbdata/psergey/mysql-4.1-code-cleanup sql/item.cc: Auto merged sql/item.h: Auto merged
-rw-r--r--sql/item.cc4
-rw-r--r--sql/item.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc
index f1569b6dca6..2dabb8e26ef 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(),
diff --git a/sql/item.h b/sql/item.h
index b756d824de0..780e2fcadac 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -157,6 +157,7 @@ public:
virtual Item_result result_type () const { return REAL_RESULT; }
virtual enum_field_types field_type() const;
virtual enum Type type() const =0;
+ /* valXXX methods must return NULL or 0 or 0.0 if null_value is set. */
virtual double val()=0;
virtual longlong val_int()=0;
virtual String *val_str(String*)=0;