From 9072761e0c9486cc3d1265a1c1e2b39db8e68bf7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 9 Nov 2011 20:19:17 +0200 Subject: Make sure we can use same type as both container and simple value --- odb/relational/mysql/common.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'odb/relational/mysql/common.cxx') diff --git a/odb/relational/mysql/common.cxx b/odb/relational/mysql/common.cxx index 4c66254..f7486cd 100644 --- a/odb/relational/mysql/common.cxx +++ b/odb/relational/mysql/common.cxx @@ -33,9 +33,10 @@ namespace relational var = name + (name[name.size () - 1] == '_' ? "" : "_"); } - bool cq (type_override_ != 0 ? false: const_type (m.type ())); + bool cq (type_override_ != 0 ? false : const_type (m.type ())); semantics::type& t (type_override_ != 0 ? *type_override_ : utype (m)); + semantics::type* cont; if (semantics::class_* c = composite_wrapper (t)) { // If t is a wrapper, pass the wrapped type. Also pass the @@ -53,12 +54,14 @@ namespace relational post (mi); } } - else if (semantics::type* c = container_wrapper (t)) + // This cannot be a container if we have a type override. + // + else if (type_override_ == 0 && (cont = context::container (m))) { // The same unwrapping logic as for composite values. // member_info mi (m, - *c, + *cont, (wrapper (t) ? &t : 0), cq, var, -- cgit v1.1