From 47e006bfaeb96df82f7b6b77ddb3319a3ff72457 Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Wed, 22 Jul 2015 17:25:50 +0200 Subject: [PATCH] cql: token_restriction: Fix the check detecting contradicting restrictions The condition is incorrect after 9b52f5bf2bee8b1f1dd9d836ba8b227e5dab1fe3. We no longer express the full range as (min, min], and missing upper bound as bound as (x, min] so we don't need to exclude those cases in the check. --- cql3/restrictions/token_restriction.hh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/cql3/restrictions/token_restriction.hh b/cql3/restrictions/token_restriction.hh index 485ae1affd..0b8c8da021 100644 --- a/cql3/restrictions/token_restriction.hh +++ b/cql3/restrictions/token_restriction.hh @@ -95,14 +95,10 @@ public: * * In practice, we want to return an empty result set if either startToken > endToken, or both are equal but * one of the bound is excluded (since [a, a] can contains something, but not (a, a], [a, a) or (a, a)). - * Note though that in the case where startToken or endToken is the minimum token, then this special case - * rule should not apply. */ - if (start_token.is_minimum() - && end_token.is_maximum() - && (start_token > end_token - || (start_token == end_token - && (!include_start || !include_end)))) { + if (start_token > end_token + || (start_token == end_token + && (!include_start || !include_end))) { return {query::partition_range::make_open_ended_both_sides()}; }