Description of problem: When the UI queries the AuditLog table, it doesn't require a filter (only getting the first 100 records). The generated query is: SELECT * FROM (SELECT * FROM audit_log WHERE ( audit_log_id > 0 and audit_log_id IN (SELECT audit_log.audit_log_id FROM audit_log ) and not deleted) ORDER BY audit_log_id DESC ,audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 100 when in fact it should be SELECT * FROM (SELECT * FROM audit_log WHERE ( audit_log_id > 0 and not deleted) ORDER BY audit_log_id DESC ,audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 100; Version-Release number of selected component (if applicable): How reproducible: Call SearchQuery.searchAuditLogEvents. Steps to Reproduce: 1. 2. 3. Actual results: SELECT * FROM (SELECT * FROM audit_log WHERE ( audit_log_id > 0 and audit_log_id IN (SELECT audit_log.audit_log_id FROM audit_log ) and not deleted) ORDER BY audit_log_id DESC ,audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 100 Expected results: SELECT * FROM (SELECT * FROM audit_log WHERE ( audit_log_id > 0 and not deleted) ORDER BY audit_log_id DESC ,audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 100; Additional info:
the main events tab (which has paging) or the various subtabs? or the bottom list of events (showing the last one only by default)? > SELECT * FROM (SELECT * FROM audit_log WHERE ( audit_log_id > 0 and not deleted) ORDER BY audit_log_id DESC ,audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 100; why ORDER BY audit_log_id DESC ,audit_log_id DESC (audit_log_id DESC, twice)?
(In reply to Itamar Heim from comment #1) > the main events tab (which has paging) or the various subtabs? or the bottom > list of events (showing the last one only by default)? > > > > SELECT * FROM (SELECT * FROM audit_log WHERE ( audit_log_id > 0 and not deleted) ORDER BY audit_log_id DESC ,audit_log_id DESC ) as T1 OFFSET (1 -1) LIMIT 100; > > why ORDER BY audit_log_id DESC ,audit_log_id DESC > (audit_log_id DESC, twice)? This is a bug of course (altough it has no harm since the PG optimizer will filter this redundancy) and was addressed as a part of teh suggested patch.
fixed in commit: b922343