Skip to content

Commit ddd67d0

Browse files
authored
Merge pull request #589 from SuhwanJang/develop
FIX: need to clear elems_result in process_bop_mget_single() when ret…
2 parents 6e90b54 + e6455f8 commit ddd67d0

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

engines/default/coll_btree.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3910,9 +3910,6 @@ ENGINE_ERROR_CODE btree_elem_get(const char *key, const uint32_t nkey,
39103910
: UPD_BT_ELEM_DELETE));
39113911
}
39123912

3913-
eresult->elem_array = NULL;
3914-
eresult->elem_count = 0;
3915-
39163913
LOCK_CACHE();
39173914
ret = do_btree_item_find(key, nkey, DO_UPDATE, &it);
39183915
if (ret == ENGINE_SUCCESS) {
@@ -4045,9 +4042,6 @@ ENGINE_ERROR_CODE btree_posi_find_with_get(const char *key, const uint32_t nkey,
40454042
int bkrtype = do_btree_bkey_range_type(bkrange);
40464043
assert(bkrtype == BKEY_RANGE_TYPE_SIN);
40474044

4048-
eresult->elem_array = NULL;
4049-
eresult->elem_count = 0;
4050-
40514045
LOCK_CACHE();
40524046
ret = do_btree_item_find(key, nkey, DO_UPDATE, &it);
40534047
if (ret == ENGINE_SUCCESS) {
@@ -4092,9 +4086,6 @@ ENGINE_ERROR_CODE btree_elem_get_by_posi(const char *key, const uint32_t nkey,
40924086
hash_item *it;
40934087
ENGINE_ERROR_CODE ret;
40944088

4095-
eresult->elem_array = NULL;
4096-
eresult->elem_count = 0;
4097-
40984089
LOCK_CACHE();
40994090
ret = do_btree_item_find(key, nkey, DO_UPDATE, &it);
41004091
if (ret == ENGINE_SUCCESS) {

engines/default/coll_list.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,6 @@ ENGINE_ERROR_CODE list_elem_get(const char *key, const uint32_t nkey,
541541
: UPD_LIST_ELEM_DELETE));
542542
}
543543

544-
eresult->elem_array = NULL;
545-
eresult->elem_count = 0;
546-
547544
LOCK_CACHE();
548545
ret = do_list_item_find(key, nkey, DO_UPDATE, &it);
549546
if (ret == ENGINE_SUCCESS) {

engines/default/coll_map.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,6 @@ ENGINE_ERROR_CODE map_elem_get(const char *key, const uint32_t nkey,
887887
: UPD_MAP_ELEM_DELETE));
888888
}
889889

890-
eresult->elem_array = NULL;
891-
eresult->elem_count = 0;
892-
893890
LOCK_CACHE();
894891
ret = do_map_item_find(key, nkey, DO_UPDATE, &it);
895892
if (ret == ENGINE_SUCCESS) {

engines/default/coll_set.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -809,9 +809,6 @@ ENGINE_ERROR_CODE set_elem_get(const char *key, const uint32_t nkey,
809809
: UPD_SET_ELEM_DELETE));
810810
}
811811

812-
eresult->elem_array = NULL;
813-
eresult->elem_count = 0;
814-
815812
LOCK_CACHE();
816813
ret = do_set_item_find(key, nkey, DO_UPDATE, &it);
817814
if (ret == ENGINE_SUCCESS) {

engines/default/default_engine.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,9 @@ default_list_elem_get(ENGINE_HANDLE* handle, const void* cookie,
533533
ENGINE_ERROR_CODE ret;
534534
VBUCKET_GUARD(engine, vbucket);
535535

536+
eresult->elem_array = NULL;
537+
eresult->elem_count = 0;
538+
536539
if (delete) ACTION_BEFORE_WRITE(cookie, key, nkey);
537540
else ACTION_BEFORE_READ(cookie, key, nkey);
538541
ret = list_elem_get(key, nkey, from_index, to_index, delete, drop_if_empty,
@@ -653,6 +656,9 @@ default_set_elem_get(ENGINE_HANDLE* handle, const void* cookie,
653656
ENGINE_ERROR_CODE ret;
654657
VBUCKET_GUARD(engine, vbucket);
655658

659+
eresult->elem_array = NULL;
660+
eresult->elem_count = 0;
661+
656662
if (delete) ACTION_BEFORE_WRITE(cookie, key, nkey);
657663
else ACTION_BEFORE_READ(cookie, key, nkey);
658664
ret = set_elem_get(key, nkey, count, delete, drop_if_empty,
@@ -772,6 +778,9 @@ default_map_elem_get(ENGINE_HANDLE* handle, const void* cookie,
772778
ENGINE_ERROR_CODE ret;
773779
VBUCKET_GUARD(engine, vbucket);
774780

781+
eresult->elem_array = NULL;
782+
eresult->elem_count = 0;
783+
775784
if (delete) ACTION_BEFORE_WRITE(cookie, key, nkey);
776785
else ACTION_BEFORE_READ(cookie, key, nkey);
777786
ret = map_elem_get(key, nkey, numfields, flist, delete, drop_if_empty,
@@ -932,6 +941,9 @@ default_btree_elem_get(ENGINE_HANDLE* handle, const void* cookie,
932941
ENGINE_ERROR_CODE ret;
933942
VBUCKET_GUARD(engine, vbucket);
934943

944+
eresult->elem_array = NULL;
945+
eresult->elem_count = 0;
946+
935947
if (delete) ACTION_BEFORE_WRITE(cookie, key, nkey);
936948
else ACTION_BEFORE_READ(cookie, key, nkey);
937949
ret = btree_elem_get(key, nkey, bkrange, efilter, offset, req_count,
@@ -984,6 +996,9 @@ default_btree_posi_find_with_get(ENGINE_HANDLE* handle, const void* cookie,
984996
ENGINE_ERROR_CODE ret;
985997
VBUCKET_GUARD(engine, vbucket);
986998

999+
eresult->elem_array = NULL;
1000+
eresult->elem_count = 0;
1001+
9871002
ACTION_BEFORE_READ(cookie, key, nkey);
9881003
ret = btree_posi_find_with_get(key, nkey, bkrange, order, count,
9891004
position, eresult);
@@ -1000,6 +1015,9 @@ default_btree_elem_get_by_posi(ENGINE_HANDLE* handle, const void* cookie,
10001015
ENGINE_ERROR_CODE ret;
10011016
VBUCKET_GUARD(engine, vbucket);
10021017

1018+
eresult->elem_array = NULL;
1019+
eresult->elem_count = 0;
1020+
10031021
ACTION_BEFORE_READ(cookie, key, nkey);
10041022
ret = btree_elem_get_by_posi(key, nkey, order, from_posi, to_posi, eresult);
10051023
return ret;

0 commit comments

Comments
 (0)