Issue 2624: Multi-status queries are broken
Status:  New
Owner: ----
Reported by knoo...@gmail.com, Apr 29, 2014
Affected Version: 2.8.4

What steps will reproduce the problem?

The following scenarios involve the REST interface to Gerrit, but my colleague has found that multi-status queries are also broken in the web-UI for Gerrit.

In the examples below, I'll be citing a case with sparse data in the system, but I expect that it may be reproduced with more data in the system too.

Assume that the system has at least two components:

my_active_project (with several changesets, in status "OPEN", "MERGED" and "ABANDONED").
my_empty_project (with no associated changeset data)


Scenario 1.

1. Log into Gerrit. 

2. Construct a URL like the following, with a valid project (which exists in Gerrit) such as "my_empty_project":

https://code.rdkcentral.com/r/changes/?q=project%3Amy_empty_project&q=status%3Aopen&q=status%3Amerged&q=status%3Aabandoned&o=LABELS&o=CURRENT_REVISION&o=CURRENT_COMMIT

Here's the bug: data for "my_active_project" are returned, even though the project selected in the query is "my_empty_project".

(The behaviour was very different in Gerrit 2.7; only data for the selected project would be returned.)

It's the three status parameters which trigger the bug. To show this look at:

https://code.rdkcentral.com/r/changes/?q=project%3Amy_empty_project&o=LABELS&o=CURRENT_REVISION&o=CURRENT_COMMIT

In this case, no data are returned, just an empty array, which is correct.


Scenario 2, with alternative syntax...

https://code.rdkcentral.com/r/changes/?q=project%3Amy_active_component+status%3Aopen+status%3Amerged+status%3Aabandoned&o=LABELS&o=CURRENT_REVISION&o=CURRENT_COMMIT&o=CURRENT_FILES

...returns no data, when it really should (since "my_active_component" contains several changesets).

Narrowing the query down to just one status value does work:

https://code.rdkcentral.com/r/changes/?q=project%3Amy_active_component+status%3Aopen&o=LABELS&o=CURRENT_REVISION&o=CURRENT_COMMIT&o=CURRENT_FILES

In this case, data for the selected status value are returned.