Bug 1252906 - Search based on negated fields with null values doesn't work properly
Summary: Search based on negated fields with null values doesn't work properly
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: General
Version: ---
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ovirt-4.2.0
: 4.2.0
Assignee: Ravi Nori
QA Contact: Lucie Leistnerova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-12 13:31 UTC by Yaniv Bronhaim
Modified: 2019-04-28 14:03 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-20 10:45:01 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.2+
rule-engine: planning_ack+
mperina: devel_ack+
lsvaty: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 69945 0 master MERGED core : Search based on negated fields with null values doesn't work properly 2017-01-17 14:19:35 UTC
oVirt gerrit 82192 0 master MERGED engine : Negated search in storage domains doesn't work 2017-10-03 14:05:37 UTC

Description Yaniv Bronhaim 2015-08-12 13:31:53 UTC
el6.7 setup
oVirt Engine Version: 3.6.0-0.0.master.20150804111407.git122a3a0.el6

I added few vms and tried to search for custom_emulated_machine!=a, it returned empty list. Same for custom_cpu_type!=[any string I tried]

Expected results:
In my case - I should see all the vms that I added to my setup, none of them fits to custom_emulated_machine==a condition

Comment 1 Red Hat Bugzilla Rules Engine 2015-10-19 10:50:22 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 2 Sandro Bonazzola 2016-05-02 09:50:17 UTC
Moving from 4.0 alpha to 4.0 beta since 4.0 alpha has been already released and bug is not ON_QA.

Comment 3 Shahar Havivi 2017-01-09 10:07:38 UTC
The problem is not just in custom_emulated_machine, or custom_cpu_type but in any field that is nullable including the Vm.Description.

the search query build this sql query:
SELECT * FROM ((SELECT distinct vms.* FROM  vms   WHERE  vms.description  NOT ILIKE 'a' )  ORDER BY vm_name ASC ) as T1 OFFSET (1 -1) LIMIT 100;

any vm description that is null will not return since it should be Not/Is Null.

Comment 4 Shahar Havivi 2017-01-09 10:18:02 UTC
possible solution can be:
when using the 'NOT' in search we may be able to add "AND NOT NULL".
but need to see if it doesn't break other search behaviors.

Comment 7 Martin Perina 2017-01-10 12:24:47 UTC
Based on comment 3 we have an issue with all negated conditions applied to all fields containing null values. As we don't have any customer reports on that, it may not be used widely, so targeting to 4.2 and when patch is ready let's discuss backports

Comment 8 Lucie Leistnerova 2017-01-27 09:48:58 UTC
By testing shared storage/disk BZ 1320774 I run into problem with negative search.

Query - Storage: datacenter != Default and datacenter != dc2 - shared ISO storage is shown in result, but should not be.

Comment 9 Lucie Leistnerova 2017-09-01 13:17:57 UTC
Negative search in VMs works fine, but still searching of shared iso domain doesn't.

Steps to Reproduce:
1. Create two Data Centers dc1, dc2
2. Attach same ISO domain to both dc
3. search in Storage domains - datacenter != dc1 and datacenter != dc2

The iso domain is in the result but should not be.

tested in ovirt-engine-4.2.0-0.0.master.20170831223128.git34f4d69.el7.centos.noarch

Comment 10 Red Hat Bugzilla Rules Engine 2017-09-01 13:18:04 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 11 Lucie Leistnerova 2017-10-16 10:33:07 UTC
shared iso domain (shared disk too) is not displayed when searching with datacenter!=xx

verified in ovirt-engine-4.2.0-0.0.master.20171013142622.git15e767c.el7.centos.noarch

Comment 12 Sandro Bonazzola 2017-12-20 10:45:01 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.