From 6c231f46e8b15bb7497aa5e8e7efa19ce73c7df1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 16 Sep 2011 16:54:41 +0200 Subject: 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. --- odb/relational/source.hxx | 5 +---- 1 file changed, 1 insertion(+), 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 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 oc (table, true); -- cgit v1.1