diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-12-22 10:27:56 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-01-20 15:43:45 +0200 |
commit | c81d68fd7c0bf884942bd5108008d9718ae87719 (patch) | |
tree | 57f62d8751fb535da29c760ca93991d77a49ca86 /odb/relational/mssql | |
parent | 3e4e38efb15ef11d228995a70a38b23dd0445246 (diff) |
Correct NULL handling in object pointers
Diffstat (limited to 'odb/relational/mssql')
-rw-r--r-- | odb/relational/mssql/source.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
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 ();"; |