diff options
Diffstat (limited to 'tests/analyser_filters.ml')
-rw-r--r-- | tests/analyser_filters.ml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/analyser_filters.ml b/tests/analyser_filters.ml index 864cab7..ef51e0c 100644 --- a/tests/analyser_filters.ml +++ b/tests/analyser_filters.ml @@ -35,7 +35,7 @@ let simple_filter () = let chunk_predicates = Filters.generate_sql ~conf filter chunk_links in let expected_predicates = Chunk.create () in - Chunk.add_string expected_predicates " WHERE 1=COALESCE('source'.'col_1',0)"; + Chunk.add_string expected_predicates " WHERE (1=COALESCE('source'.'col_1',0))"; Alcotest.(check @@ pair Test_migration.chunk Test_migration.chunk) "Simple predicate" @@ -58,7 +58,7 @@ let multiple_filters () = (* The predicates can be executed in reverse order, but it’s not an issue because they all are applied at the same time in the projection *) Chunk.add_string expected_predicates - " WHERE COALESCE('source'.'col_1','')=?\nAND 1"; + " WHERE (COALESCE('source'.'col_1','')=?)\nAND (1)"; Alcotest.(check @@ pair Test_migration.chunk Test_migration.chunk) "Combined predicate" @@ -109,7 +109,7 @@ let expression_with_group () = "WITH filter0 AS (SELECT source.id, LAST_VALUE('source'.'col_1') OVER \ (PARTITION BY 'source'.'col_1' ORDER BY 'source'.'col_1' RANGE BETWEEN \ UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)=1 AS group_function\n\ - FROM 'source' AS 'source' WHERE 1=COALESCE('source'.'col_1',0))\n"; + FROM 'source' AS 'source' WHERE (1=COALESCE('source'.'col_1',0)))\n"; Alcotest.(check @@ pair Test_migration.chunk Test_migration.chunk) "The predicate expression is inside of the CTE" @@ -130,7 +130,7 @@ let group_with_expression () = Chunk.add_string expected_predicates "\n\ INNER JOIN 'filter0' ON filter0.id = source.id\n\ - WHERE 1=COALESCE('source'.'col_1',0) AND filter0.group_function"; + WHERE (1=COALESCE('source'.'col_1',0)) AND filter0.group_function"; let expected_links = Chunk.create () in Chunk.add_string expected_links |