aboutsummaryrefslogtreecommitdiff
path: root/odb/relational/source.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-02-05 14:17:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-02-05 14:17:07 +0200
commit2ca4828d303fdd27c573429910f7a25fd1e3727c (patch)
treed2637c11861d44a634ecc09bbe88c3a3ff350b16 /odb/relational/source.cxx
parent8e69f40ab32dc8604b68f360ae30fa961ba036ee (diff)
Implement result modifiers in view query condition
Diffstat (limited to 'odb/relational/source.cxx')
-rw-r--r--odb/relational/source.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/odb/relational/source.cxx b/odb/relational/source.cxx
index 39a210e..dc083bb 100644
--- a/odb/relational/source.cxx
+++ b/odb/relational/source.cxx
@@ -4770,6 +4770,8 @@ traverse_view (type& c)
if (!i->alias.empty ())
l += (need_alias_as ? " AS " : " ") + quote_id (i->alias);
+ l += from_trailer (c);
+
from.push_back (l);
continue;
}
@@ -4829,6 +4831,8 @@ traverse_view (type& c)
if (!alias.empty ())
l += (need_alias_as ? " AS " : " ") + quote_id (alias);
+ l += from_trailer (c);
+
from.push_back (l);
if (poly_depth != 1)
@@ -5539,7 +5543,7 @@ traverse_view (type& c)
string sep (versioned || query_optimize ? "\n" : " ");
os << "query_base_type r (" << endl
- << strlit ("SELECT" + sep);
+ << strlit ((vq.distinct ? "SELECT DISTINCT" : "SELECT") + sep);
for (statement_columns::const_iterator i (sc.begin ()),
e (sc.end ()); i != e;)
@@ -5632,6 +5636,13 @@ traverse_view (type& c)
<< "r += c.clause_prefix ();"
<< "r += c;"
<< "}";
+
+ string st (select_trailer (c));
+ if (!st.empty ())
+ {
+ os << "r += " << strlit (sep) << ";"
+ << "r += " << strlit (st) << ";";
+ }
}
else
{