Skip to content

Commit 3a6a2bc

Browse files
Doug RohrerLuke Bakken
authored andcommitted
Add another object to 2i with bucket types test in order to attempt to reproduce issue in riak_kv#1329
1 parent 5fb3e40 commit 3a6a2bc

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

tests/bucket_types.erl

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ confirm() ->
285285
true ->
286286
Obj01 = riakc_obj:new(<<"test">>, <<"JRD">>, <<"John Robert Doe, 25">>),
287287
Obj02 = riakc_obj:new({Type, <<"test">>}, <<"JRD">>, <<"Jane Rachel Doe, 21">>),
288+
Obj03 = riakc_obj:new({Type, <<"test">>}, <<"JRD2">>, <<"Jane2 Rachel2 Doe2, 22">>),
288289

289290
Obj1 = riakc_obj:update_metadata(Obj01,
290291
riakc_obj:set_secondary_index(
@@ -302,8 +303,16 @@ confirm() ->
302303
[<<"Jane">>, <<"Rachel">>
303304
,<<"Doe">>]}])),
304305

305-
riakc_pb_socket:put(PB, Obj1),
306-
riakc_pb_socket:put(PB, Obj2),
306+
Obj3 = riakc_obj:update_metadata(Obj03,
307+
riakc_obj:set_secondary_index(
308+
riakc_obj:get_update_metadata(Obj03),
309+
[{{integer_index, "age"},
310+
[22]},{{binary_index, "name"},
311+
[<<"Jane2">>, <<"Rachel2">>
312+
,<<"Doe2">>]}])),
313+
ok = riakc_pb_socket:put(PB, Obj1),
314+
ok = riakc_pb_socket:put(PB, Obj2),
315+
ok = riakc_pb_socket:put(PB, Obj3),
307316

308317
?assertMatch({ok, {index_results_v1, [<<"JRD">>], _, _}}, riakc_pb_socket:get_index(PB, <<"test">>,
309318
{binary_index,
@@ -322,7 +331,14 @@ confirm() ->
322331
"name"},
323332
<<"Jane">>)),
324333

325-
%% wild stab at the undocumented cs_bucket_fold
334+
?assertMatch({ok, {index_results_v1, [<<"JRD2">>], _, _}}, riakc_pb_socket:get_index(PB,
335+
{Type,
336+
<<"test">>},
337+
{binary_index,
338+
"name"},
339+
<<"Jane2">>)),
340+
341+
%% wild stab at the undocumented cs_bucket_fold
326342
{ok, ReqID} = riakc_pb_socket:cs_bucket_fold(PB, <<"test">>, []),
327343
accumulate(ReqID),
328344

0 commit comments

Comments
 (0)