From d4ba5cc187a7a10db3004e0543d4e27a82a5bd0f Mon Sep 17 00:00:00 2001 From: Piotr Sarna Date: Wed, 12 Jun 2019 09:29:12 +0200 Subject: [PATCH] tests: add a test case for filtering clustering key The test cases makes sure that clustering key restriction columns are fetched for filtering if they form a clustering key prefix, but not a primary key prefix (partition key columns are missing). Ref #4541 --- tests/filtering_test.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/filtering_test.cc b/tests/filtering_test.cc index f7a31af5cee8..baf33c668967 100644 --- a/tests/filtering_test.cc +++ b/tests/filtering_test.cc @@ -791,6 +791,13 @@ SEASTAR_TEST_CASE(test_allow_filtering_with_secondary_index) { } }); }); + + eventually([&] { + auto msg = e.execute_cql("SELECT SUM(e) FROM t WHERE c = 5 AND b = 911 ALLOW FILTERING;").get0(); + assert_that(msg).is_rows().with_rows({{ int32_type->decompose(0), {} }}); + msg = e.execute_cql("SELECT e FROM t WHERE c = 5 AND b = 3 ALLOW FILTERING;").get0(); + assert_that(msg).is_rows().with_rows({{ int32_type->decompose(9), int32_type->decompose(3) }}); + }); }); }