Closed mdecuir closed 4 years ago
@mdecuir Thanks for the report! This query should emit the same error regardless of whether the property is indexed or not, we should have a fix in shortly. We'll report back here, but the bug and its fix will be on https://github.com/RedisGraph/redisgraph.
The IN operator always expects to work on an array, so the simplest syntax looks like:
MATCH (n) WHERE n.name IN ['name1', 'name2'] RETURN n
Though more complex constructs that evaluate to arrays are also fine!
The reason I ran into this is because the documentation I could find did not indicate how to wrap the values for an IN predicate.
Incidentally, this also might be a distinct bug, but when I have an IN predicate on an indexed property, even with the correct syntax, I am getting no results back from the query. I can still do equality checks on the indexed property without issue, but I don't know if any other operators are behaving strangely
@mdecuir Those were actually two distinct issues, with the latter specifically affecting string properties only. I've resolved that and fixed the error reporting in this PR: https://github.com/RedisGraph/RedisGraph/pull/735
We'll have it merged soon! The enhancement that allowed for index scans to utilize IN filters is quite new, it looks like we had some kinks to iron out still. Sorry about that!
Additionally, I've opened an issue to improve our documentation in this area at https://github.com/RedisGraph/RedisGraph/issues/733.
@mdecuir, I've merged @jeffreylovitz fix, can you please verify? thank you.
@mdecuir I'm closing this issue, I believe it is not valid. If you think it is still valid please re-open it.
While trying to figure out the proper syntax for using the IN operator in a WHERE clause, I came across a pattern that consistently would cause RedisGraph to crash.
I am running on the edge build of RedisGraph.
When I have an index on a property and submit a query with a where clause of the form
WHERE n.name IN 'name'
, the server will consistently crash with the below stack dump. When I run the same query without the index, the query encounters errors, but the server remains stable.