@@ -610,6 +610,51 @@ pgroup:add('test_composite_index', function(g)
610610 t .assert_equals (err , nil )
611611 local objects = crud .unflatten_rows (result .rows , result .metadata )
612612 t .assert_equals (objects , helpers .get_objects_by_idxs (customers , {2 , 1 })) -- in full_name order
613+
614+ -- first 1
615+ local result , err = g .cluster .main_server .net_box :call (' crud.select' , {' customers' , conditions , {first = 1 }})
616+ t .assert_equals (err , nil )
617+ local objects = crud .unflatten_rows (result .rows , result .metadata )
618+ t .assert_equals (objects , helpers .get_objects_by_idxs (customers , {2 })) -- in full_name order
619+
620+ -- first 1 with full specified key
621+ local result , err = g .cluster .main_server .net_box :call (' crud.select' ,
622+ {' customers' , {{' ==' , ' full_name' , {' Elizabeth' , ' Johnson' }}}, {first = 1 }})
623+ t .assert_equals (err , nil )
624+ local objects = crud .unflatten_rows (result .rows , result .metadata )
625+ t .assert_equals (objects , helpers .get_objects_by_idxs (customers , {2 })) -- in full_name order
626+ end )
627+
628+ pgroup :add (' test_composite_primary_index' , function (g )
629+ local book_translation = helpers .insert_objects (g , ' book_translation' , {
630+ {
631+ id = 5 ,
632+ language = ' Ukrainian' ,
633+ edition = 55 ,
634+ translator = ' Mitro Dmitrienko' ,
635+ comments = ' Translation 55' ,
636+ }
637+ })
638+ t .assert_equals (# book_translation , 1 )
639+
640+ local conditions = {{' =' , ' id' , {5 , ' Ukrainian' , 55 }}}
641+
642+ local result , err = g .cluster .main_server .net_box :call (' crud.select' , {' book_translation' , conditions })
643+ t .assert_equals (err , nil )
644+ t .assert_equals (# result .rows , 1 )
645+
646+ local result , err = g .cluster .main_server .net_box :call (' crud.select' , {' book_translation' , conditions , {first = 2 }})
647+ t .assert_equals (err , nil )
648+ t .assert_equals (# result .rows , 1 )
649+
650+ local result , err = g .cluster .main_server .net_box :call (' crud.select' , {' book_translation' , conditions , {first = 1 }})
651+ t .assert_equals (err , nil )
652+ t .assert_equals (# result .rows , 1 )
653+
654+ local result , err = g .cluster .main_server .net_box :call (' crud.select' ,
655+ {' book_translation' , conditions , {first = 1 , after = result .rows [1 ]}})
656+ t .assert_equals (err , nil )
657+ t .assert_equals (# result .rows , 0 )
613658end )
614659
615660pgroup :add (' test_select_with_batch_size_1' , function (g )
0 commit comments