500 error when filtering group issues / MRs with search params and invalid author
https://sentry.gitlab.net/gitlab/devgitlaborg/issues/1009767/
This comes from this URL: https://dev.gitlab.org/groups/gitlab/-/merge_requests?scope=all&utf8=✓&state=merged&author_username=jameslopez&search=cache
If it worked, this wouldn't return anything: the username is wrong. (James is @james
on dev.)
Filtering by author with the wrong username works fine: https://dev.gitlab.org/groups/gitlab/-/merge_requests?scope=all&utf8=%E2%9C%93&state=merged&author_username=jameslopez
But when the search param is added, the CTE gets a NULL inner somehow.
WITH "merge_requests" AS (NULL) SELECT "merge_requests".* FROM merge_requests WHERE ("merge_requests"."title" ILIKE '%cache%' OR "merge_requests"."description" ILIKE '%cache%') ORDER BY "merge_requests"."updated_at" DESC, "merge_requests"."id" DESC LIMIT 20 OFFSET 0
I can reproduce on GitLab.com: https://gitlab.com/groups/gitlab-org/-/issues?author_username=12345zcvb&search=foo