From 39ece65fd176084e7dc1a356dcbcf0f29c3824d0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 20 Jun 2019 15:51:05 +0200 Subject: Fix bug in handling of indexes over object pointers with composite ids --- odb/relational/model.hxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/odb/relational/model.hxx b/odb/relational/model.hxx index d27cb63..ef21e13 100644 --- a/odb/relational/model.hxx +++ b/odb/relational/model.hxx @@ -457,7 +457,12 @@ namespace relational index::member& im (*j); - if (type* comp = composite_wrapper (utype (*im.path.back ()))) + semantics::type* t (&utype (*im.path.back ())); + + if (semantics::class_* ptr = object_pointer (*t)) + t = &utype (*id_member (*ptr)); + + if (type* comp = composite_wrapper (*t)) { // Composite value. Get the list of the columns. Note that // the column prefix needs to contain all the components. -- cgit v1.1