diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-16 16:54:41 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-16 16:54:41 +0200 |
commit | 6c231f46e8b15bb7497aa5e8e7efa19ce73c7df1 (patch) | |
tree | 4ce349d918d2926ac8dcbba192b99af229846bae | |
parent | b79567fbc72df23f870049652d5f254aba948bea (diff) |
Don't use DISTINCT in generated SELECT statements
We needed it before for objects that involved relationships (and therefore
JOINs) but it appears with the new JOIN handling approach (no merging of
multiple relationships into a single JOIN), we don't need DISTINCT anymore.
All the tests pass and all the examples produce identical output with and
without DISTINCT.
-rw-r--r-- | odb/relational/source.hxx | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx index 502d9f0..86d60c7 100644 --- a/odb/relational/source.hxx +++ b/odb/relational/source.hxx @@ -2351,11 +2351,8 @@ namespace relational instance<object_joins> oj (c, t); //@@ (im)perfect forwarding oj->traverse (c); - // We only need DISTINCT if there are joins (object pointers) - // and can optimize it out otherwise. - // os << "const char " << traits << "::query_clause[] =" << endl - << strlit (oj->count () ? "SELECT DISTINCT " : "SELECT ") << endl; + << strlit ("SELECT ") << endl; { instance<object_columns> oc (table, true); |