From 4df47b9e4a4d50be46e8cf8bfd83ad1b14775e9d Mon Sep 17 00:00:00 2001
From: "serg@serg.mylan" <>
Date: Thu, 2 Jun 2005 15:45:20 +0200
Subject: [PATCH] cleanup

---
 extra/yassl/src/ssl.cpp | 2 +-
 sql/item_func.cc        | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp
index 466884f3cd..84ffb9b582 100644
--- a/extra/yassl/src/ssl.cpp
+++ b/extra/yassl/src/ssl.cpp
@@ -36,7 +36,7 @@
 #include "handshake.hpp"
 #include "yassl_int.hpp"
 #include <stdio.h>
-
+#include "runtime.hpp"
 
 namespace yaSSL {
 
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 3767844e20..6e630fd389 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2325,9 +2325,6 @@ longlong Item_func_field::val_int()
 {
   DBUG_ASSERT(fixed == 1);
 
-  if (args[0]->is_null())
-    return 0;
-
   if (cmp_type == STRING_RESULT)
   {
     String *field;
@@ -2343,6 +2340,8 @@ longlong Item_func_field::val_int()
   else if (cmp_type == INT_RESULT)
   {
     longlong val= args[0]->val_int();
+    if (args[0]->null_value)
+      return 0;
     for (uint i=1; i < arg_count ; i++)
     {
       if (!args[i]->is_null() && val == args[i]->val_int())
@@ -2353,6 +2352,8 @@ longlong Item_func_field::val_int()
   {
     my_decimal dec_arg_buf, *dec_arg,
                dec_buf, *dec= args[0]->val_decimal(&dec_buf);
+    if (args[0]->null_value)
+      return 0;
     for (uint i=1; i < arg_count; i++)
     {
       dec_arg= args[i]->val_decimal(&dec_arg_buf);
@@ -2363,6 +2364,8 @@ longlong Item_func_field::val_int()
   else
   {
     double val= args[0]->val_real();
+    if (args[0]->null_value)
+      return 0;
     for (uint i=1; i < arg_count ; i++)
     {
       if (!args[i]->is_null() && val == args[i]->val_real())
-- 
2.30.9