Skip to content

Commit

Permalink
much proper fix
Browse files Browse the repository at this point in the history
  • Loading branch information
igorcoding committed May 5, 2024
1 parent d94744b commit ed65582
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions tests/files/app.lua
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,22 @@ function truncate()
_truncate(box.space.tester)
_truncate(box.space.no_schema_space)

if box.space.sql_space ~= nil then
box.execute('DELETE FROM sql_space')
box.execute('DELETE FROM SQL_SPACE')
end

if box.space.sql_space_autoincrement ~= nil then
box.execute('DELETE FROM sql_space_autoincrement')
box.execute('DELETE FROM SQL_SPACE_AUTOINCREMENT')
end

if box.space.sql_space_autoincrement_multiple ~= nil then
box.execute('DELETE FROM sql_space_autoincrement_multiple')
box.execute('DELETE FROM SQL_SPACE_AUTOINCREMENT_MULTIPLE')
local sql_spaces = {
'sql_space',
'sql_space_autoincrement',
'sql_space_autoincrement_multiple',
}
for _, sql_space in ipairs(sql_spaces) do
local variants = {
sql_space,
sql_space:upper(),
}

for _, variant in ipairs(variants) do
if box.space[variant] ~= nil then
box.execute('DELETE FROM ' .. variant)
end
end
end

_truncate(box.space.tester_ext_dec)
Expand Down

0 comments on commit ed65582

Please sign in to comment.