Open laggingreflex opened 4 years ago
At first glance, your assumption of Anakin OR NOT Kenobi
being the same as NOT Kenobi
sounds good.
Checking the code, the OR NOT operator negates the result from the right side, so 1 would become -1, and -5 would become 5.
The string filters return 0 when something doesn't match. -0 still returns 0, so you've stumbled upon a bug here (I should check how other implementations handle this case though)
What would/should this return?
Currently it returns both
Anakin Skywalker
andObi-Wan Kenobi
. Which is the same result if you'd have omitted theNOT
.Is it a bug that
NOT
is ignored here, or is it by design?To me the
OR NOT
operator itself seems broken by design. Remember this is not a simple boolean expression, it's supposed to filter out rows from the data. To me, in plain English, the query "Anakin OR NOT Kenobi" reads somewhat like this:Get all rows that match "Anakin"
OR - what does OR mean here? If Step 1 has any results, should it just return that?
Get all rows that do NOT match "Kenobi" - i.e. all rows except "Obi-Wan Kenobi".
Step 3 will ALWAYS include the rows from Step 1, no?
To me,
Anakin OR NOT Kenobi
is same as justNOT Kenobi
Am I misunderstanding something?