Bug 962560

Summary: Search query "sortby" return some wrongly sorted results
Product: Red Hat Enterprise Virtualization Manager Reporter: Tomas Von Veschler <tvvcox>
Component: ovirt-engineAssignee: Eli Mesika <emesika>
Status: CLOSED CURRENTRELEASE QA Contact: Ondra Machacek <omachace>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: acathrow, bazulay, emesika, iheim, jkt, lpeer, pstehlik, Rhev-m-bugs, yeylon
Target Milestone: ---   
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: is10 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1019461    
Attachments:
Description Flags
Screenshot of the manager showing the problem none

Description Tomas Von Veschler 2013-05-13 21:07:47 UTC
Created attachment 747446 [details]
Screenshot of the manager showing the problem

Description of problem:

At the admin portal use the following search string:

Vms: sortby cpu_usage desc 

Top 2 results are powered off VMs with 0% CPU usage (see attached screenshot). They shouldn't be on top.

Version-Release number of selected component (if applicable):

3.1.0-50.el6ev

How reproducible:

Always

Additional info:

RHEV-M API is also affected when using:

/api/vms?search=sortby+cpu_usage+desc

Comment 1 Eli Mesika 2013-05-14 00:14:56 UTC
This is the ORDER BY Syntax :

    ORDER BY sort_expression1 [ASC | DESC] [NULLS { FIRST | LAST }]
             [, sort_expression2 [ASC | DESC] [NULLS { FIRST | LAST }] ...]

The NULLS FIRST and NULLS LAST options can be used to determine whether nulls appear before or after non-null values in the sort ordering. By default, null values sort as if larger than any non-null value; that is, NULLS FIRST is the default for DESC order, and NULLS LAST otherwise.

Taking the bug

Comment 4 Eli Mesika 2013-08-12 12:58:01 UTC
fixed in commit : c2a2d65

Comment 5 Ondra Machacek 2013-09-03 10:09:44 UTC
Verified is12.
Vms are correctly sorted by cpu usage.

Comment 6 Itamar Heim 2014-01-21 22:23:24 UTC
Closing - RHEV 3.3 Released

Comment 7 Itamar Heim 2014-01-21 22:24:30 UTC
Closing - RHEV 3.3 Released

Comment 8 Itamar Heim 2014-01-21 22:28:05 UTC
Closing - RHEV 3.3 Released