From c81d68fd7c0bf884942bd5108008d9718ae87719 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 22 Dec 2011 10:27:56 +0200 Subject: Correct NULL handling in object pointers --- odb/relational/mssql/source.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'odb') diff --git a/odb/relational/mssql/source.cxx b/odb/relational/mssql/source.cxx index eddd782..629f823 100644 --- a/odb/relational/mssql/source.cxx +++ b/odb/relational/mssql/source.cxx @@ -569,11 +569,13 @@ namespace relational // if (object_pointer (member_utype (mi.m, key_prefix_))) { - os << "}"; + os << "}" + << "else" << endl; if (!null (mi.m, key_prefix_)) - os << "else" << endl - << "throw null_pointer ();"; + os << "throw null_pointer ();"; + else + os << "i." << mi.var << "size_ind = SQL_NULL_DATA;"; } os << "}"; @@ -879,7 +881,7 @@ namespace relational << "typedef pointer_traits< " << mi.fq_type () << " > ptr_traits;" << endl - << "if (i." << mi.var << "indicator == -1)" << endl; + << "if (i." << mi.var << "size_ind == SQL_NULL_DATA)" << endl; if (null (mi.m, key_prefix_)) os << member << " = ptr_traits::pointer_type ();"; -- cgit v1.1