@@ -3,7 +3,9 @@ local fio = require('fio')
33local t = require (' luatest' )
44local g_memtx = t .group (' select_memtx' )
55local g_vinyl = t .group (' select_vinyl' )
6+
67local crud = require (' crud' )
8+ local crud_utils = require (' crud.common.utils' )
79
810local helpers = require (' test.helper' )
911
@@ -48,6 +50,8 @@ local function before_all(g, engine)
4850 })
4951 g .engine = engine
5052 g .cluster :start ()
53+
54+ g .space_format = g .cluster .servers [2 ].net_box .space .customers :format ()
5155end
5256
5357g_memtx .before_all = function () before_all (g_memtx , ' memtx' ) end
@@ -174,7 +178,7 @@ add('test_select_all', function(g)
174178 t .assert_equals (objects , customers )
175179
176180 -- after obj 2
177- local after = customers [2 ]
181+ local after = crud_utils . flatten ( customers [2 ], g . space_format )
178182 local result , err = g .cluster .main_server .net_box :eval ([[
179183 local crud = require('crud')
180184
@@ -189,7 +193,7 @@ add('test_select_all', function(g)
189193 t .assert_equals (objects , get_by_ids (customers , {3 , 4 }))
190194
191195 -- after obj 4 (last)
192- local after = customers [4 ]
196+ local after = crud_utils . flatten ( customers [4 ], g . space_format )
193197 local result , err = g .cluster .main_server .net_box :eval ([[
194198 local crud = require('crud')
195199
@@ -308,7 +312,7 @@ add('test_negative_first', function(g)
308312 -- no conditions
309313 -- first -3 after 5 (batch_size is 1)
310314 local first = - 3
311- local after = customers [5 ]
315+ local after = crud_utils . flatten ( customers [5 ], g . space_format )
312316 local batch_size = 1
313317 local result , err = g .cluster .main_server .net_box :eval ([[
314318 local crud = require('crud')
@@ -333,7 +337,7 @@ add('test_negative_first', function(g)
333337 {' >=' , ' id' , 2 },
334338 }
335339 local first = - 2
336- local after = customers [5 ]
340+ local after = crud_utils . flatten ( customers [5 ], g . space_format )
337341 local batch_size = 1
338342 local result , err = g .cluster .main_server .net_box :eval ([[
339343 local crud = require('crud')
@@ -358,7 +362,7 @@ add('test_negative_first', function(g)
358362 {' >=' , ' age' , 22 },
359363 }
360364 local first = - 2
361- local after = customers [5 ]
365+ local after = crud_utils . flatten ( customers [5 ], g . space_format )
362366 local batch_size = 1
363367 local result , err = g .cluster .main_server .net_box :eval ([[
364368 local crud = require('crud')
@@ -383,7 +387,7 @@ add('test_negative_first', function(g)
383387 {' <=' , ' id' , 6 },
384388 }
385389 local first = - 2
386- local after = customers [5 ]
390+ local after = crud_utils . flatten ( customers [5 ], g . space_format )
387391 local batch_size = 1
388392 local result , err = g .cluster .main_server .net_box :eval ([[
389393 local crud = require('crud')
@@ -408,7 +412,7 @@ add('test_negative_first', function(g)
408412 {' <=' , ' age' , 66 },
409413 }
410414 local first = - 2
411- local after = customers [5 ]
415+ local after = crud_utils . flatten ( customers [5 ], g . space_format )
412416 local batch_size = 1
413417 local result , err = g .cluster .main_server .net_box :eval ([[
414418 local crud = require('crud')
@@ -552,7 +556,7 @@ add('test_eq_condition_with_index', function(g)
552556 t .assert_equals (objects , get_by_ids (customers , {1 , 3 , 5 , 7 })) -- in id order
553557
554558 -- after obj 3
555- local after = customers [3 ]
559+ local after = crud_utils . flatten ( customers [3 ], g . space_format )
556560 local result , err = g .cluster .main_server .net_box :eval ([[
557561 local crud = require('crud')
558562
@@ -607,7 +611,7 @@ add('test_ge_condition_with_index', function(g)
607611 t .assert_equals (objects , get_by_ids (customers , {3 , 2 , 4 })) -- in age order
608612
609613 -- after obj 3
610- local after = customers [3 ]
614+ local after = crud_utils . flatten ( customers [3 ], g . space_format )
611615 local result , err = g .cluster .main_server .net_box :eval ([[
612616 local crud = require('crud')
613617
@@ -662,7 +666,7 @@ add('test_le_condition_with_index',function(g)
662666 t .assert_equals (objects , get_by_ids (customers , {3 , 1 })) -- in age order
663667
664668 -- after obj 3
665- local after = customers [3 ]
669+ local after = crud_utils . flatten ( customers [3 ], g . space_format )
666670 local result , err = g .cluster .main_server .net_box :eval ([[
667671 local crud = require('crud')
668672
@@ -717,7 +721,7 @@ add('test_lt_condition_with_index', function(g)
717721 t .assert_equals (objects , get_by_ids (customers , {1 })) -- in age order
718722
719723 -- after obj 1
720- local after = customers [1 ]
724+ local after = crud_utils . flatten ( customers [1 ], g . space_format )
721725 local result , err = g .cluster .main_server .net_box :eval ([[
722726 local crud = require('crud')
723727
@@ -777,7 +781,7 @@ add('test_multiple_conditions', function(g)
777781 t .assert_equals (objects , get_by_ids (customers , {5 , 2 })) -- in age order
778782
779783 -- after obj 5
780- local after = customers [5 ]
784+ local after = crud_utils . flatten ( customers [5 ], g . space_format )
781785 local result , err = g .cluster .main_server .net_box :eval ([[
782786 local crud = require('crud')
783787
@@ -832,7 +836,7 @@ add('test_composite_index', function(g)
832836 t .assert_equals (objects , get_by_ids (customers , {2 , 1 , 4 })) -- in full_name order
833837
834838 -- after obj 2
835- local after = customers [2 ]
839+ local after = crud_utils . flatten ( customers [2 ], g . space_format )
836840 local result , err = g .cluster .main_server .net_box :eval ([[
837841 local crud = require('crud')
838842
0 commit comments