diff options
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. // |