Change in ovirt-engine[ovirt-engine-3.5]: core: do not use distinct if sort expr have func

Oved Ourfali has submitted this change and it was merged. Change subject: core: do not use distinct if sort expr have func ...................................................................... core: do not use distinct if sort expr have func A former patch made by Omer F added distinct to the search in order to prevent duplicates. In the case the search is in the format : SELECT DISTINCT * FROM T .... ORDER BY f({arguments}) There is a problem since the DISTINCT is performed first and then the sorting, so f is unknown since it is not part of the result set. This patch checks if the sort clause has a function call and removes the DISTINCT if it finds one. Also added a unit test for this case. Change-Id: I7c036b2b9ee94266b6e3df54f2c50167e454ed6a Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1198506 Signed-off-by: emesika <emesika@redhat.com> --- M backend/manager/modules/searchbackend/src/main/java/org/ovirt/engine/core/searchbackend/SyntaxChecker.java M backend/manager/modules/searchbackend/src/test/java/org/ovirt/engine/core/searchbackend/SyntaxCheckerTest.java 2 files changed, 16 insertions(+), 7 deletions(-) Approvals: Eli Mesika: Verified Oved Ourfali: Looks good to me, approved -- To view, visit https://gerrit.ovirt.org/38492 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7c036b2b9ee94266b6e3df54f2c50167e454ed6a Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Eli Mesika <emesika@redhat.com> Gerrit-Reviewer: Eli Mesika <emesika@redhat.com> Gerrit-Reviewer: Liran Zelkha <lzelkha@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofrenkel@redhat.com> Gerrit-Reviewer: Oved Ourfali <oourfali@redhat.com> Gerrit-Reviewer: automation@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server
participants (1)
-
oourfali@redhat.com