Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Crash when sorting by nonexistent field #1734
Executing the query string "--" exposes a bug in the query parser.
The same occurs for any sequence of dashses longer than two: "-------" results in the same crash. Interestingly, "----foo" does not.
It seems to be actually a particular case of another bug: if a query term (that is not a field-query, and not a regular expression query) ends with
At the current revision (0a719a0):
There is also some interference/ambiguity with the syntax of
One of the culprits seems to be the
Thanks for digging deeper! You're absolutely right about the cause.
About the ambiguity: great point. From my perspective, it's not all that important who "wins" for a query like
And about the fix: It should be legal to sort by fields that don't exist on all entries in the database. In the same way that
In fact, perhaps the fix is as simple as changing that line to: