From ce03afff5ef2e8da677def73079864c31c6618d8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 24 Jan 2013 15:10:22 +0200 Subject: Add support for mapping char[N] to CHAR/VARCHAR database types Also improve query support for arrays (decaying). --- odb/context.cxx | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'odb/context.cxx') diff --git a/odb/context.cxx b/odb/context.cxx index 46116f6..515e9a8 100644 --- a/odb/context.cxx +++ b/odb/context.cxx @@ -720,13 +720,6 @@ null (semantics::data_member& m) const } else pt = &t; - - // See if this is one of the types with built-in mapping. - // - type_map_type::const_iterator i (data_->type_map_.find (*pt, hint)); - - if (i != data_->type_map_.end ()) - return i->second.null; } } @@ -811,13 +804,6 @@ null (semantics::data_member& m, string const& kp) const } else pt = &t; - - // See if this is one of the types with built-in mapping. - // - type_map_type::const_iterator i (data_->type_map_.find (*pt, hint)); - - if (i != data_->type_map_.end ()) - return i->second.null; } } } @@ -1749,12 +1735,19 @@ find (semantics::type& t, semantics::names* hint) } string context:: -database_type_impl (semantics::type& t, semantics::names* hint, bool id) +database_type_impl (semantics::type& t, + semantics::names* hint, + bool id, + bool* null) { type_map_type::const_iterator i (data_->type_map_.find (t, hint)); if (i != data_->type_map_.end ()) + { + if (null != 0) + *null = i->second.null; return id ? i->second.id_type : i->second.type; + } else return string (); } -- cgit v1.1