Skip to content

Commit 9226f91

Browse files
test: do not drop SQL_BUILTIN functions
SQL_BUILTIN was introduced in [1] (tarantool 2.2.1) and dropped in [2] (tarantool 2.10.0-beta2). It is not permitted to drop SQL_BUILTIN functions, thus, before this patch, tarantool_python_ci.lua was unable to run with versions between 2.2.1 and 2.10.0-beta2, failing with `ER_DROP_FUNCTION: Can't drop function 1: function is SQL built-in`. This patch fixes this. tarantool_python_ci.lua is used to start a tarantool instance for Windows tests. 1. tarantool/tarantool@200a492 2. tarantool/tarantool@c49eab9 Part of #182
1 parent 0f95f28 commit 9226f91

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

test/suites/lib/tarantool_python_ci.lua

+15-7
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,23 @@ clean = function()
179179
end)
180180

181181
local _FUNC_NAME = 3
182+
local _FUNC_LANGUAGE = 5
182183
local allowed_funcs = {
183184
['box.schema.user.info'] = true,
184185
}
186+
local allowed_langs = {
187+
['SQL_BUILTIN'] = true,
188+
}
185189
box.space._func:pairs():map(function(tuple)
186190
local name = tuple[_FUNC_NAME]
187-
return name
188-
end):filter(function(name)
189-
return not allowed_funcs[name]
190-
end):each(function(name)
191-
box.schema.func.drop(name)
191+
local lang = tuple[_FUNC_LANGUAGE]
192+
return { name = name, lang = lang }
193+
end):filter(function(prop)
194+
return not allowed_funcs[prop.name]
195+
end):filter(function(prop)
196+
return not allowed_langs[prop.lang]
197+
end):each(function(prop)
198+
box.schema.func.drop(prop.name)
192199
end)
193200

194201
cleanup_cluster()
@@ -333,8 +340,9 @@ clean = function()
333340
local user_count = box.space._user:count()
334341
assert(user_count == 4 or user_count == 5,
335342
'box.space._user:count() should be 4 (1.10) or 5 (2.0)')
336-
assert(box.space._func:count() == 1,
337-
'box.space._func:count() should be only one')
343+
local func_count = box.space._func:count()
344+
assert(func_count == 1 or func_count == 67,
345+
'box.space._func:count() should be 1 (1.10 and >= 2.10) or 67 (>= 2.2.1, < 2.10)')
338346
assert(box.space._cluster:count() == 1,
339347
'box.space._cluster:count() should be only one')
340348

0 commit comments

Comments
 (0)