diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-10-02 17:07:21 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-10-02 17:07:21 +0200 |
commit | a06b917d661a61aad88dbf4351494b7c84273dc6 (patch) | |
tree | 0221f9c6a9bda91a672d9686e8c9dd8543c0ada8 /common/view/test.hxx | |
parent | 8c858f038f9ae213d962d49d5c5ca085a73e588f (diff) |
If query substituting placeholder is empty, pass true expression instead
This allows uniform usage of views both with and without any extra
conditions. Also optimize some common cases so that we don't have
useless WHERE TRUE clauses or (...) AND (TRUE) expressions.
Diffstat (limited to 'common/view/test.hxx')
-rw-r--r-- | common/view/test.hxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/view/test.hxx b/common/view/test.hxx index 2497097..b5b9d65 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -164,7 +164,7 @@ struct view1b // Runtime query. // -#pragma db view query() +#pragma db view //query() struct view1c { std::string first; @@ -415,7 +415,7 @@ struct view10 // Composite in object. // #pragma db view object(person) \ - query((person::measures.weight > 60 && person::measures.hight < 190) \ + query((person::measures.weight > 60 && person::measures.hight < 190 && (?)) \ + "ORDER BY" + person::age) struct view11 { |