@@ -89,17 +89,17 @@ local count_safety_cases = {
8989 nil_and_nil_opts = {
9090 has_crit = true ,
9191 user_conditions = nil ,
92- opts = nil ,
92+ opts = { mode = ' write ' } ,
9393 },
9494 fullscan_false = {
9595 has_crit = true ,
9696 user_conditions = nil ,
97- opts = {fullscan = false },
97+ opts = {fullscan = false , mode = ' write ' },
9898 },
9999 fullscan_true = {
100100 has_crit = false ,
101101 user_conditions = nil ,
102- opts = {fullscan = true },
102+ opts = {fullscan = true , mode = ' write ' },
103103 },
104104 non_equal_conditions = {
105105 has_crit = true ,
@@ -109,7 +109,7 @@ local count_safety_cases = {
109109 {' >' , ' age' , 20 },
110110 {' <' , ' age' , 30 },
111111 },
112- opts = nil ,
112+ opts = { mode = ' write ' } ,
113113 },
114114 equal_condition = {
115115 has_crit = false ,
@@ -118,7 +118,7 @@ local count_safety_cases = {
118118 {' <=' , ' last_name' , ' Z' },
119119 {' =' , ' age' , 25 },
120120 },
121- opts = nil ,
121+ opts = { mode = ' write ' } ,
122122 },
123123 equal_condition2 = {
124124 has_crit = false ,
@@ -127,7 +127,7 @@ local count_safety_cases = {
127127 {' <=' , ' last_name' , ' Z' },
128128 {' ==' , ' age' , 25 },
129129 },
130- opts = nil ,
130+ opts = { mode = ' write ' } ,
131131 },
132132}
133133
@@ -179,9 +179,9 @@ pgroup.test_count_all = function(g)
179179 },
180180 })
181181
182- local result , err = g .cluster .main_server .net_box :call (' crud.count' ,
183- { ' customers' , nil , {fullscan = true }}
184- )
182+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
183+ ' customers' , nil , {fullscan = true , mode = ' write ' },
184+ } )
185185
186186 t .assert_equals (err , nil )
187187 t .assert_equals (result , 5 )
@@ -215,9 +215,9 @@ pgroup.test_count_all_with_yield_every = function(g)
215215 },
216216 })
217217
218- local result , err = g .cluster .main_server .net_box :call (' crud.count' ,
219- { ' customers' , nil , {yield_every = 1 , fullscan = true }}
220- )
218+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
219+ ' customers' , nil , {yield_every = 1 , fullscan = true , mode = ' write ' },
220+ } )
221221
222222 t .assert_equals (err , nil )
223223 t .assert_equals (result , 5 )
@@ -251,9 +251,9 @@ pgroup.test_count_all_with_yield_every_0 = function(g)
251251 },
252252 })
253253
254- local result , err = g .cluster .main_server .net_box :call (' crud.count' ,
255- { ' customers' , nil , {yield_every = 0 , fullscan = true } }
256- )
254+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
255+ ' customers' , nil , {yield_every = 0 , fullscan = true , mode = ' write ' }
256+ } )
257257
258258 t .assert_equals (result , nil )
259259 t .assert_str_contains (err .err , " yield_every should be > 0" )
@@ -289,9 +289,9 @@ pgroup.test_count_by_primary_index = function(g)
289289
290290 local conditions = {{' ==' , ' id_index' , 3 }}
291291
292- local result , err = g .cluster .main_server .net_box :call (' crud.count' ,
293- { ' customers' , conditions }
294- )
292+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
293+ ' customers' , conditions , { mode = ' write ' },
294+ } )
295295
296296 t .assert_equals (err , nil )
297297 t .assert_equals (result , 1 )
@@ -331,9 +331,9 @@ pgroup.test_eq_condition_with_index = function(g)
331331
332332 local expected_len = 2
333333
334- local result , err = g .cluster .main_server .net_box :call (' crud.count' ,
335- { ' customers' , conditions }
336- )
334+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
335+ ' customers' , conditions , { mode = ' write ' },
336+ } )
337337
338338 t .assert_equals (err , nil )
339339 t .assert_equals (result , expected_len )
@@ -373,9 +373,9 @@ pgroup.test_ge_condition_with_index = function(g)
373373
374374 local expected_len = 3
375375
376- local result , err = g .cluster .main_server .net_box :call (' crud.count' ,
377- { ' customers' , conditions , {fullscan = true }}
378- )
376+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
377+ ' customers' , conditions , {fullscan = true , mode = ' write ' },
378+ } )
379379
380380 t .assert_equals (err , nil )
381381 t .assert_equals (result , expected_len )
@@ -415,9 +415,9 @@ pgroup.test_gt_condition_with_index = function(g)
415415
416416 local expected_len = 1
417417
418- local result , err = g .cluster .main_server .net_box :call (' crud.count' ,
419- { ' customers' , conditions , {fullscan = true }}
420- )
418+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
419+ ' customers' , conditions , {fullscan = true , mode = ' write ' },
420+ } )
421421
422422 t .assert_equals (err , nil )
423423 t .assert_equals (result , expected_len )
@@ -457,9 +457,9 @@ pgroup.test_le_condition_with_index = function(g)
457457
458458 local expected_len = 4
459459
460- local result , err = g .cluster .main_server .net_box :call (' crud.count' ,
461- { ' customers' , conditions , {fullscan = true }}
462- )
460+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
461+ ' customers' , conditions , {fullscan = true , mode = ' write ' },
462+ } )
463463
464464 t .assert_equals (err , nil )
465465 t .assert_equals (result , expected_len )
@@ -499,9 +499,9 @@ pgroup.test_lt_condition_with_index = function(g)
499499
500500 local expected_len = 2
501501
502- local result , err = g .cluster .main_server .net_box :call (' crud.count' ,
503- { ' customers' , conditions , {fullscan = true }}
504- )
502+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
503+ ' customers' , conditions , {fullscan = true , mode = ' write ' },
504+ } )
505505
506506 t .assert_equals (err , nil )
507507 t .assert_equals (result , expected_len )
@@ -543,9 +543,9 @@ pgroup.test_multiple_conditions = function(g)
543543
544544 local expected_len = 2
545545
546- local result , err = g .cluster .main_server .net_box :call (' crud.count' ,
547- { ' customers' , conditions }
548- )
546+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
547+ ' customers' , conditions , { mode = ' write ' },
548+ } )
549549
550550 t .assert_equals (err , nil )
551551 t .assert_equals (result , expected_len )
@@ -565,17 +565,17 @@ pgroup.test_multipart_primary_index = function(g)
565565 })
566566
567567 local conditions = {{' =' , ' primary' , 0 }}
568- local result , err = g .cluster .main_server .net_box :call (' crud.count' ,
569- { ' coord' , conditions }
570- )
568+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
569+ ' coord' , conditions , { mode = ' write ' },
570+ } )
571571
572572 t .assert_equals (err , nil )
573573 t .assert_equals (result , 3 )
574574
575575 local conditions = {{' =' , ' primary' , {0 , 2 }}}
576- local result , err = g .cluster .main_server .net_box :call (' crud.count' ,
577- { ' coord' , conditions }
578- )
576+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
577+ ' coord' , conditions , { mode = ' write ' },
578+ } )
579579
580580 t .assert_equals (err , nil )
581581 t .assert_equals (result , 1 )
@@ -649,7 +649,7 @@ pgroup.test_count_no_map_reduce = function(g)
649649 local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
650650 ' customers' ,
651651 nil ,
652- {bucket_id = 2804 , timeout = 1 , fullscan = true },
652+ {bucket_id = 2804 , timeout = 1 , fullscan = true , mode = ' write ' },
653653 })
654654 t .assert_equals (err , nil )
655655 t .assert_equals (result , 1 )
@@ -663,7 +663,7 @@ pgroup.test_count_no_map_reduce = function(g)
663663 local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
664664 ' customers' ,
665665 {{' ==' , ' age' , 81 }},
666- {bucket_id = 1161 , timeout = 1 },
666+ {bucket_id = 1161 , timeout = 1 , mode = ' write ' },
667667 })
668668 t .assert_equals (err , nil )
669669 t .assert_equals (result , 1 )
@@ -709,9 +709,9 @@ pgroup.test_count_timeout = function(g)
709709 local timeout = 4
710710 local begin = clock .proc ()
711711
712- local result , err = g .cluster .main_server .net_box :call (' crud.count' ,
713- { ' customers' , conditions , {timeout = timeout , fullscan = true }}
714- )
712+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
713+ ' customers' , conditions , {timeout = timeout , fullscan = true , mode = ' write ' },
714+ } )
715715
716716 t .assert_equals (err , nil )
717717 t .assert_equals (result , expected_len )
@@ -751,7 +751,9 @@ pgroup.test_composite_index = function(g)
751751 }
752752
753753 -- no after
754- local result , err = g .cluster .main_server .net_box :call (' crud.count' , {' customers' , conditions , {fullscan = true }})
754+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
755+ ' customers' , conditions , {fullscan = true , mode = ' write' },
756+ })
755757
756758 t .assert_equals (err , nil )
757759 t .assert_equals (result , 4 )
@@ -761,7 +763,9 @@ pgroup.test_composite_index = function(g)
761763 {' ==' , ' full_name' , " Elizabeth" },
762764 }
763765
764- local result , err = g .cluster .main_server .net_box :call (' crud.count' , {' customers' , conditions })
766+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
767+ ' customers' , conditions , {mode = ' write' },
768+ })
765769
766770 t .assert_equals (err , nil )
767771 t .assert_equals (result , 3 )
@@ -781,7 +785,9 @@ pgroup.test_composite_primary_index = function(g)
781785
782786 local conditions = {{' =' , ' id' , {5 , ' Ukrainian' , 55 }}}
783787
784- local result , err = g .cluster .main_server .net_box :call (' crud.count' , {' book_translation' , conditions })
788+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
789+ ' book_translation' , conditions , {mode = ' write' },
790+ })
785791 t .assert_equals (err , nil )
786792 t .assert_equals (result , 1 )
787793end
@@ -815,7 +821,9 @@ pgroup.test_count_by_full_sharding_key = function(g)
815821 })
816822
817823 local conditions = {{' ==' , ' id' , 3 }}
818- local result , err = g .cluster .main_server .net_box :call (' crud.count' , {' customers' , conditions })
824+ local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
825+ ' customers' , conditions , {mode = ' write' },
826+ })
819827
820828 t .assert_equals (err , nil )
821829 t .assert_equals (result , 1 )
@@ -846,14 +854,14 @@ pgroup.test_count_force_map_call = function(g)
846854 })
847855
848856 local result , err = g .cluster .main_server .net_box :call (' crud.count' , {
849- ' customers' , {{' ==' , ' id' , key }},
857+ ' customers' , {{' ==' , ' id' , key }}, { mode = ' write ' },
850858 })
851859
852860 t .assert_equals (err , nil )
853861 t .assert_equals (result , 1 )
854862
855863 result , err = g .cluster .main_server .net_box :call (' crud.count' , {
856- ' customers' , {{' ==' , ' id' , key }}, {force_map_call = true }
864+ ' customers' , {{' ==' , ' id' , key }}, {force_map_call = true , mode = ' write ' },
857865 })
858866
859867 t .assert_equals (err , nil )
0 commit comments