Bug 1252906 - Search based on negated fields with null values doesn't work properly
Search based on negated fields with null values doesn't work properly
Status: ASSIGNED
Product: ovirt-engine
Classification: oVirt
Component: General (Show other bugs)
---
Unspecified Unspecified
low Severity medium (vote)
: ovirt-4.2.0
: ---
Assigned To: Ravi Nori
Lucie Leistnerova
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-12 09:31 EDT by Yaniv Bronhaim
Modified: 2017-09-01 09:18 EDT (History)
14 users (show)

See Also:
Fixed In Version:
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: ---
rule-engine: ovirt‑4.2+
rule-engine: planning_ack+
mperina: devel_ack+
lsvaty: testing_ack+


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 69945 master MERGED core : Search based on negated fields with null values doesn't work properly 2017-01-17 09:19 EST

  None (edit)
Description Yaniv Bronhaim 2015-08-12 09:31:53 EDT
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 06:50:22 EDT
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 05:50:17 EDT
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 05:07:38 EST
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 05:18:02 EST
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 07:24:47 EST
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 04:48:58 EST
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 09:17:57 EDT
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 09:18:04 EDT
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.

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