diff --git a/.github/workflows/quick-check.yml b/.github/workflows/quick-check.yml index 5b76edf..a7f5fdf 100644 --- a/.github/workflows/quick-check.yml +++ b/.github/workflows/quick-check.yml @@ -1,7 +1,7 @@ name: quick_check on: - push: + pull_request: repository_dispatch: workflow_dispatch: @@ -37,7 +37,7 @@ jobs: - name: Install tarantool build prerequisites run: | - sudo apt-get install -y patch ccache luarocks libmsgpuck-dev libluajit-5.1-dev + sudo apt-get install -y patch ccache luarocks libmsgpuck-dev libluajit-5.1-dev libunwind-dev # by some odd reason we can't use # working-directory: $GITHUB_WORKSPACE/tarantool/build diff --git a/create_table.lua b/create_table.lua index fb26e5b..d199f36 100644 --- a/create_table.lua +++ b/create_table.lua @@ -7,6 +7,8 @@ local mem_size = 10 * 1024^3 local function config(portN, memSz) box.cfg{ listen = tonumber(portN), memtx_memory = tonumber(memSz) } + local fiber = require('fiber') + fiber.set_max_slice(60 * 60) -- "1 hour should be enough for everybody" end local function show_usage() @@ -165,13 +167,18 @@ local tables = { 'region', 'nation', 'part', 'supplier', 'partsupp', 'customer', 'orders', 'lineitem' } + for _, tblname in ipairs(tables) do local f = assert(io.open(string.format("tpch-dbgen/%s.tbl", tblname), 'rb')) - print (tblname) + box.begin() + local sql_table = tblname:upper() + local lines = 0 + print ('Loading: ', tblname) while true do local line = f:read('*line') if not line then break end + lines = lines + 1 local t = {} for s in string.gmatch(line, '[^|]+') do @@ -193,9 +200,26 @@ for _, tblname in ipairs(tables) do end local tuple = box.tuple.new(t) - box.space[tblname:upper()]:insert(tuple) + local rc, msg = pcall(box.space[sql_table].insert, box.space[sql_table], tuple) + if not rc then + print(('database %s failed to insert tuple %s: %s'): + format(sql_table, require'json'.encode(tuple), msg)) + end end f:close() + box.commit() + -- sanity check - assume we have successfully inserted all tuples + local check_lines = box.execute(('select count(*) from %s'):format(sql_table)) + if not check_lines then + error(('database %s is not existing'):format(sql_table)) + end + local count = check_lines.rows[1][1] + if count ~= lines then + error(('database %s contains %d rows, but expected %d'): + format(sql_table, count, lines)) + else + print(('.... %d rows loaded'):format(lines)) + end end box.snapshot() diff --git a/execute_query.lua b/execute_query.lua index 3c69763..1fa4c99 100644 --- a/execute_query.lua +++ b/execute_query.lua @@ -20,6 +20,8 @@ io.stdout:setvbuf 'no' local function config(portN, memSz) if not dryrun then box.cfg{ listen = tonumber(portN), memtx_memory = tonumber(memSz) } + local fiber = require('fiber') + fiber.set_max_slice(60 * 60) -- "1 hour should be enough for everybody" end end