diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-11-09 20:19:17 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-11-09 20:19:17 +0200 |
commit | 9072761e0c9486cc3d1265a1c1e2b39db8e68bf7 (patch) | |
tree | 1e284d8088e51a962bd285b02f8096ed088463ee /odb/relational/sqlite/common.cxx | |
parent | dfba83f1ef3b5856d36dc29da0b6e02f51bc36b3 (diff) |
Make sure we can use same type as both container and simple value
Diffstat (limited to 'odb/relational/sqlite/common.cxx')
-rw-r--r-- | odb/relational/sqlite/common.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/odb/relational/sqlite/common.cxx b/odb/relational/sqlite/common.cxx index 357fb87..e3bf73c 100644 --- a/odb/relational/sqlite/common.cxx +++ b/odb/relational/sqlite/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, |