Skip to content

Commit

Permalink
CBQE-246: fix for startkey_docid\endkey_docid case
Browse files Browse the repository at this point in the history
ignore startkey_docid\endkey_docid if doc id dosn't exist

Change-Id: I9b0c283cd7dae0614295683bed6b90f3a058b6e1
Reviewed-on: http://review.couchbase.org/17549
Reviewed-by: Tommie McAfee <tommie@couchbase.com>
Tested-by: Iryna Mironava <irynamironava@yandex.ru>
  • Loading branch information
IrynaMironava committed Jun 25, 2012
1 parent 039cb55 commit 49ea1f1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions pytests/viewquerytests.py
Expand Up @@ -1149,7 +1149,6 @@ def _preload_matching_query_keys(self, query, type_filter = None):
mo_idx = 1
days_skipped_offset = 0
for months in years['months'][q_start_mo:q_end_mo + 1]:

# at end month only include up to N days
if (mo_idx + q_start_mo - 1) == q_end_mo:
mo_days = months['days'][1:q_end_day + 1]
Expand Down Expand Up @@ -1205,13 +1204,19 @@ def _preload_matching_query_keys(self, query, type_filter = None):

if 'startkey_docid' in q_params:
startkey_docid = q_params['startkey_docid'].strip("\"")
start_idx = query.expected_keys.index(startkey_docid)
query.expected_keys = query.expected_keys[start_idx:]
try:
start_idx = query.expected_keys.index(startkey_docid)
query.expected_keys = query.expected_keys[start_idx:]
except ValueError:
pass

if 'endkey_docid' in q_params:
endkey_docid = q_params['endkey_docid'].strip("\"")
end_idx = query.expected_keys.index(endkey_docid)
query.expected_keys = query.expected_keys[:end_idx + 1]
try:
end_idx = query.expected_keys.index(endkey_docid)
query.expected_keys = query.expected_keys[:end_idx + 1]
except ValueError:
pass
if inclusive_end == False:
query.expected_keys = query.expected_keys[:-1]

Expand Down

0 comments on commit 49ea1f1

Please sign in to comment.