Author: wyoung
Date: Wed Aug  6 23:31:31 2008
New Revision: 2329

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2329&view=rev
Log:
Fixed a null comparison bug discovered on Solaris, but not limited to
it.  Likely the test case passed elsewhere due to differing memory
initialization policies.

Modified:
    trunk/lib/null.h

Modified: trunk/lib/null.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/null.h?rev=2329&r1=2328&r2=2329&view=diff
==============================================================================
--- trunk/lib/null.h (original)
+++ trunk/lib/null.h Wed Aug  6 23:31:31 2008
@@ -289,14 +289,14 @@
        /// for the base data type.
        bool operator <(const Null<Type>& rhs) const
        {
-               if (is_null && rhs.is_null) {
-                       return false;
-               }
-               else if (is_null && !rhs.is_null) {
-                       return true;
+               if (is_null) {
+                       return !rhs.is_null;    // less than only if RHS not 
null
+               }
+               else if (rhs.is_null) {
+                       return false;                   // non-null always 
greater than null
                }
                else {
-                       return data < rhs.data;
+                       return data < rhs.data; // neither is null, so compare 
data
                }
        }
 


_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits

Reply via email to