diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-02-05 14:17:07 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-02-05 14:17:07 +0200 |
commit | 2ca4828d303fdd27c573429910f7a25fd1e3727c (patch) | |
tree | d2637c11861d44a634ecc09bbe88c3a3ff350b16 /odb/relational/processor.cxx | |
parent | 8e69f40ab32dc8604b68f360ae30fa961ba036ee (diff) |
Implement result modifiers in view query condition
Diffstat (limited to 'odb/relational/processor.cxx')
-rw-r--r-- | odb/relational/processor.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/odb/relational/processor.cxx b/odb/relational/processor.cxx index 7658725..16904b6 100644 --- a/odb/relational/processor.cxx +++ b/odb/relational/processor.cxx @@ -1298,11 +1298,23 @@ namespace relational vq.kind = view_query::condition; } else - vq.kind = view_query::runtime; + vq.kind = (vq.distinct || vq.for_update) + ? view_query::condition // The query(distinct) case. + : view_query::runtime; } else vq.kind = has_o ? view_query::condition : view_query::runtime; + if ((vq.distinct || vq.for_update) && vq.kind != view_query::condition) + { + error (vq.loc) + << "result modifier specified for " + << (vq.kind == view_query::runtime ? "runtime" : "native") + << " query" << endl; + + throw operation_failed (); + } + // We cannot have an incomplete query if there are not objects // to derive the rest from. // |