Skip to content

Commit e4f1ca9

Browse files
committed
Fix 1.10.6 compatibility
1 parent 96d735e commit e4f1ca9

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

crud/compare/keydef.lua

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ local comparators = require('crud.compare.comparators')
22
local collations = require('crud.common.collations')
33

44
local compat = require('crud.common.compat')
5-
local has_keydef = compat.exists('tuple.keydef', 'key_def')
6-
7-
local keydef_lib
8-
if has_keydef then
9-
keydef_lib = compat.require('tuple.keydef', 'key_def')
10-
end
5+
local keydef_lib = compat.require('tuple.keydef', 'key_def')
116

127
-- As "tuple.key_def" doesn't support collation_id
138
-- we manually change it to collation

crud/select/executor.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,17 @@ local function scroll_to_after_tuple(gen, space, scan_index, tarantool_iter, aft
3838
end
3939
end
4040

41-
local function generate_value(after_tuple, scan_value, index_parts, tarantool_iter)
42-
if has_keydef then
41+
local generate_value
42+
43+
if has_keydef then
44+
generate_value = function(after_tuple, scan_value, index_parts, tarantool_iter)
4345
local key_def = keydef_lib.new(index_parts)
4446
if key_def:compare_with_key(after_tuple, scan_value) < 0 then
4547
return key_def:extract_key(after_tuple)
4648
end
47-
else
49+
end
50+
else
51+
generate_value = function(after_tuple, scan_value, index_parts, tarantool_iter)
4852
local cmp_operator = select_comparators.get_cmp_operator(tarantool_iter)
4953
local scan_comparator = select_comparators.gen_tuples_comparator(cmp_operator, index_parts)
5054
local after_tuple_key = utils.extract_key(after_tuple, index_parts)

0 commit comments

Comments
 (0)