Skip to content

Commit

Permalink
lua compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
igorcoding committed May 5, 2024
1 parent 7e15526 commit 81bd382
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/files/app.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ local function bootstrap()
types = {}
}

function b:sql_space_name(space_name)
if self:check_version({3, 0}) then
return space_name
else
return space_name:upper()
end
end

function b:check_version(expected)
return check_version(expected, self.tarantool_ver)
end
Expand Down Expand Up @@ -198,15 +206,15 @@ function truncate()
_truncate(box.space.no_schema_space)

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

if box.space.sql_space_autoincrement ~= nil then
box.execute('DELETE FROM sql_space_autoincrement')
box.execute('DELETE FROM ' .. B:sql_space_name('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 ' .. B:sql_space_name('sql_space_autoincrement_multiple'))
end

_truncate(box.space.tester_ext_dec)
Expand Down

0 comments on commit 81bd382

Please sign in to comment.