Description
Problem
If doing a join in a query, and none of the joined fields are selected then the query engine panics and crashes. This should not happen as the query is still valid, there is just unused information.
For example, the query:
SELECT testA.field fieldA
|
FROM testA
|
JOIN testB testB on key testB.testA_ID for testA
|
WHERE true AND testA.foo.bar IN [5]
|
causes the query engine to return:
[
|
{
|
"code": 5001,
|
"msg": "Panic: runtime error: invalid memory address or nil pointer dereference - cause: runtime error: invalid memory address or nil pointer dereference"
|
}
|
]
|
Where as having the query as:
SELECT testA.field fieldA, testB.field fieldB
|
FROM testA
|
JOIN testB testB on key testB.testA_ID for testA
|
WHERE true AND testA.foo.bar IN [5]
|
will work just fine.
Expectation
Both queries should work and return the specified data, regardless of the fact the JOIN isn't used in the first one.