Bug 1974656 - [Rest API] Event search template filter throws SQL error
Summary: [Rest API] Event search template filter throws SQL error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.4.7.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.4.8
: ---
Assignee: Eli Mesika
QA Contact: Guilherme Santos
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-22 09:07 UTC by Martin Necas
Modified: 2021-08-23 11:15 UTC (History)
4 users (show)

Fixed In Version: ovirt-engine-4.4.8
Doc Type: No Doc Update
Doc Text:
If this bug requires documentation, please select an appropriate Doc Type value.
Clone Of:
Environment:
Last Closed: 2021-08-23 09:00:49 UTC
oVirt Team: Infra
Embargoed:
pm-rhel: ovirt-4.4+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 115561 0 master MERGED Event search template filter does not work 2021-07-06 14:31:34 UTC

Description Martin Necas 2021-06-22 09:07:08 UTC
Description of problem:
Hi,
when trying to search events in API/UI with template.name filter either returns an empty list or SQL error.

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


How reproducible:


Steps to Reproduce:
1. Request events with some specific template.name
2.
3.

Actual results:
Empty list or SQL error 

Expected results:
Filtred list of events

Additional info:

Comment 1 Eli Mesika 2021-06-27 23:39:38 UTC
search engine problem 

query generated :

SELECT * FROM ((
SELECT  distinct  audit_log.* 
FROM  audit_log   
LEFT OUTER JOIN vms_with_tags ON audit_log.vm_id=vms_with_tags.vm_guid    
LEFT OUTER JOIN vm_templates_storage_domain ON vms.vmt_guid=vm_templates_storage_domain.vmt_guid    <<<==== problem is here , vms.vmt_guid instead of vms_with_tags.vmt_guid, there is no vms view in this search query 
WHERE  vm_templates_storage_domain.name ILIKE 'a'  
AND not deleted)  ORDER BY audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 100


related to : https://gerrit.ovirt.org/#/c/ovirt-engine/+/112551/ (not a regression but seems that this case of 2 LEFT OUTER JOIN was not covered with this fix)

probably corner case , first LEFT OUTER JOIN using vms_with_tags correctly while the second LEFT OUTER JOIN uses wrong vms instead of vms_with_tags


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