Author: suresh
Date: 2005-06-29 07:31:11 -0400 (Wed, 29 Jun 2005)
New Revision: 46715

Modified:
   trunk/mcs/class/System.Data/Mono.Data.SqlExpressions/ArithmeticExpressions.cs
   trunk/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog
Log:
2005-06-29  Sureshkumar T  <[EMAIL PROTECTED]>

        * ArithmeticExpressions.cs: Eval :if any one of the argument is
        null for an operator, the result is also NULL.



Modified: 
trunk/mcs/class/System.Data/Mono.Data.SqlExpressions/ArithmeticExpressions.cs
===================================================================
--- 
trunk/mcs/class/System.Data/Mono.Data.SqlExpressions/ArithmeticExpressions.cs   
    2005-06-29 11:14:05 UTC (rev 46714)
+++ 
trunk/mcs/class/System.Data/Mono.Data.SqlExpressions/ArithmeticExpressions.cs   
    2005-06-29 11:31:11 UTC (rev 46715)
@@ -50,14 +50,14 @@
                override public object Eval (DataRow row)
                {
                        object obj1 = expr1.Eval (row);
-                       if (obj1 == DBNull.Value)
+                       if (obj1 == DBNull.Value || obj1 == null)
                                return obj1;
                        object obj2 = expr2.Eval (row);
-                       if (obj2 == DBNull.Value)
+                       if (obj2 == DBNull.Value || obj2 == null)
                                return obj2;
                
                        if (op == Operation.ADD && (obj1 is string || obj2 is 
string))
-                               return (obj1 != null ? obj1.ToString () : 
String.Empty) + (obj2 != null ? obj2.ToString () : String.Empty);
+                               return obj1.ToString () + obj2.ToString ();
                
                        IConvertible o1 = (IConvertible)obj1;
                        IConvertible o2 = (IConvertible)obj2;

Modified: trunk/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog      
2005-06-29 11:14:05 UTC (rev 46714)
+++ trunk/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog      
2005-06-29 11:31:11 UTC (rev 46715)
@@ -1,3 +1,8 @@
+2005-06-29  Sureshkumar T  <[EMAIL PROTECTED]>
+
+       * ArithmeticExpressions.cs: Eval :if any one of the argument is
+       null for an operator, the result is also NULL.
+
 2005-05-02 Konstantin Triger <[EMAIL PROTECTED]>
 
         * IExpression interface: Added DependsOn(DataColumn) method, which 
checks whether the Expression contains a specific column

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to