Between() in query causes alpha crash

Report a Dgraph Bug

What version of Dgraph are you using?


Have you tried reproducing the issue with the latest release?

yes, only on master

What is the hardware spec (RAM, OS)?

docker for mac

Steps to reproduce the issue (command/config used to run Dgraph).

start docker image, load in dataset, try query including between

Expected behaviour and actual result.

obviously I expect to have the between function evaluated. Instead, it crashes the server with the following stacktrace:

2020/10/02 04:04:18 Unknown ineqType between

seems like the new between function was simply left out of the switch statement in CompareVals(). Let me know if you need a test schema and query to reproduce, but the query had this fragment used which caused the issue:

fragment rangeFilter {
  has_range @filter(between(hstart,$start,$end) OR between(hend, $start, $end)) {

between is not a filter function.

I assume proper operation is not a server panic. Just wanted to bring it up in case it was not known.

Hey @iluminae,
currently between is only supported at root level and not inside filters.
I agree that it should not crash Dgraph if its used inside filters.

I am marking this as accepted, so that it can be fixed.

What?? There is a between I can use at the root level?

Hey @amaster507, we have recently added between at root level. It will be available in release 20.11.


I would suggest making between work in filters as well, but that is low priority for me since gt() AND lt() will do the same. Mostly it would be less confusing if you could use it everywhere.


Let’s keep this bug about preventing the crash. Please file a new enhancement request for using ‘between’ in filters.

Oh good, I thought I was going crazy.

Fixed by: