Skip to content

Commit

Permalink
Merge pull request #108 from weswil07/fix-or-nonexistence
Browse files Browse the repository at this point in the history
Disable query optimzation for 'OR nonexistence' cases.
  • Loading branch information
weswil07 authored Jan 25, 2023
2 parents 75939f2 + 49947b7 commit 7402703
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ env
/*.egg-info/
/.idea
/build
/daffodil/*.c
/daffodil/*.c
*~
*.so
2 changes: 1 addition & 1 deletion daffodil/hstore_predicate.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def forces_optimizer(children):
return False

return all(
isinstance(expr, ExpressionStr) and expr.daff_test == "?="
isinstance(expr, ExpressionStr) and expr.daff_test == "?=" and expr.daff_val == True
for expr in children
)

Expand Down
9 changes: 9 additions & 0 deletions test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,15 @@ def test_timestamp_notin(self):
)
""")

def test_or_nonexistence(self):
self.assert_filter_has_n_results(4, """
num_of_sat_test_takers = 50
[
non_existing ?= false
non_existing_too ?= false
]
""")


#def test_comparing_a_string_containing_int(self):
# self.assert_filter_has_n_results(417, """
Expand Down

0 comments on commit 7402703

Please sign in to comment.