From e8fb9e26f870c2ce8796cecbeea7d159b0a7ac04 Mon Sep 17 00:00:00 2001 From: ChineSEngineer <31991990+ChineSEngineer@users.noreply.github.com> Date: Fri, 30 Sep 2022 00:48:08 +0800 Subject: [PATCH] Avoid necessary skipping token After parsing the statement and construct the 'between operator', there is no need to call statement.skip(). This bug may cause the query ignore the eq filter when both eq and range filters exist together. For example queryset.filter(field_a=xxx).filter(field_b__range=[aaa, bbb]) --- djongo/sql2mongo/operators.py | 1 - 1 file changed, 1 deletion(-) diff --git a/djongo/sql2mongo/operators.py b/djongo/sql2mongo/operators.py index bb3bc422..df86763e 100644 --- a/djongo/sql2mongo/operators.py +++ b/djongo/sql2mongo/operators.py @@ -412,7 +412,6 @@ def _token2op(self, elif tok.match(tokens.Keyword, 'BETWEEN'): op = BetweenOp(**kw) - statement.skip(3) elif tok.match(tokens.Keyword, 'IS'): op = IsOp(**kw)