Red Hat Bugzilla – Bug 1252906
Search based on negated fields with null values doesn't work properly
Last modified: 2017-12-06 02:50:09 EST
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]
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
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.
Moving from 4.0 alpha to 4.0 beta since 4.0 alpha has been already released and bug is not ON_QA.
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.
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.
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
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.
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
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