--- upp-production/uppsrc/Core/String.h (revision 5441) +++ upp-production/uppsrc/Core/String.h (working copy) @@ -341,7 +341,7 @@ int GetCharCount() const; String() { Zero(); } - String(const Nuller&) { Zero(); } + String(const Nuller&) { ptr = (char *)(voidptr + 1); LLen() = 0; SLen() = 15; chr[KIND] = 50; } String(const String& s) { String0::Set(s); } String(const char *s); String(const String& s, int n) { ASSERT(n >= 0 && n <= s.GetLength()); String0::Set(~s, n); } @@ -495,7 +495,7 @@ } template<> -inline bool IsNull(const String& s) { return s.IsEmpty(); } +inline bool IsNull(const String& s) { return s.IsVoid(); } template<> inline String AsString(const String& s) { return s; }
Quote: |
Is there some workaround to this? I can easily imagine cases where one needs to differentiate between NULL and "" in databases. |
Quote: |
Is there some workaround to this? I can easily imagine cases where one needs to differentiate between NULL and "" in databases. |
SqlVal SqlEmptyString(){ static SqlVal s("''",SqlS::HIGH); return s; } // which can be used as sql * Insert(TBL)(SOMECOL, str.IsEmpty()?SqlEmptyString():str)