Skip to content

remove useless queries with false conditions (e.g 1=0)

What does this MR do?

Remove useless queries with false conditions (e.g 1=0).

The additional query with false condition is generated from IssuableCollections#issuable_meta_data when issuable_ids is empty:

(e.g. SELECT "merge_requests_closing_issues"."issue_id", COUNT(*) as count FROM "merge_requests_closing_issues" WHERE 1=0 GROUP BY "merge_requests_closing_issues"."issue_id" )

To reproduce it locally, visit this url: http://localhost:3000/gitlab-org/gitlab-test/issues?scope=all&utf8=%E2%9C%93&state=opened&search=test.

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #29492 (closed)

Merge request reports

Loading