From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id EF9E7263C9 for ; Thu, 28 Jun 2018 12:19:13 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mvLzvIbPxehB for ; Thu, 28 Jun 2018 12:19:13 -0400 (EDT) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 5F05F26317 for ; Thu, 28 Jun 2018 12:19:13 -0400 (EDT) From: Kirill Shcherbatov Subject: [tarantool-patches] [PATCH v2 3/3] sql: enable multi-engine tests for SQL Date: Thu, 28 Jun 2018 19:19:06 +0300 Message-Id: In-Reply-To: References: In-Reply-To: References: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: korablev@tarantool.org, Kirill Shcherbatov Configured sql tests to set 'pragma sql_engine_default' on start. This allows to test both vinyl and memtx engines for SQL. Resolves #2199. --- test/sql-tap/analyze9.test.lua | 2 ++ test/sql-tap/engine.cfg | 6 ++++ test/sql-tap/lua/sqltester.lua | 9 ++++- test/sql-tap/suite.ini | 1 + test/sql/app.lua | 3 +- test/sql/check-clear-ephemeral.result | 6 ++++ test/sql/check-clear-ephemeral.test.lua | 3 +- test/sql/checks.result | 6 ++++ test/sql/checks.test.lua | 2 ++ test/sql/clear.result | 6 ++++ test/sql/clear.test.lua | 2 ++ test/sql/collation.result | 9 +++++ test/sql/collation.test.lua | 3 ++ test/sql/delete-multiple-idx.result | 6 ++++ test/sql/delete-multiple-idx.test.lua | 2 ++ test/sql/delete.result | 6 ++++ test/sql/delete.test.lua | 2 ++ test/sql/drop-index.result | 6 ++++ test/sql/drop-index.test.lua | 2 ++ test/sql/drop-table.result | 6 ++++ test/sql/drop-table.test.lua | 2 ++ test/sql/engine.cfg | 6 ++++ test/sql/engine.result | 42 ++++++++++++++++++++++ test/sql/engine.test.lua | 17 +++++++++ test/sql/errinj.result | 9 +++++ test/sql/errinj.test.lua | 3 ++ test/sql/gh-2929-primary-key.result | 9 +++++ test/sql/gh-2929-primary-key.test.lua | 4 +++ test/sql/gh-2981-check-autoinc.result | 9 +++++ test/sql/gh-2981-check-autoinc.test.lua | 4 +++ test/sql/gh-3199-no-mem-leaks.result | 6 ++++ test/sql/gh-3199-no-mem-leaks.test.lua | 2 ++ test/sql/gh2141-delete-trigger-drop-table.result | 6 ++++ test/sql/gh2141-delete-trigger-drop-table.test.lua | 2 ++ test/sql/gh2251-multiple-update.result | 6 ++++ test/sql/gh2251-multiple-update.test.lua | 2 ++ test/sql/gh2483-remote-persistency-check.result | 6 ++++ test/sql/gh2483-remote-persistency-check.test.lua | 2 ++ .../gh2808-inline-unique-persistency-check.result | 6 ++++ ...gh2808-inline-unique-persistency-check.test.lua | 2 ++ test/sql/icu-upper-lower.result | 6 ++++ test/sql/icu-upper-lower.test.lua | 2 ++ test/sql/insert-unique.result | 6 ++++ test/sql/insert-unique.test.lua | 2 ++ test/sql/iproto.result | 9 +++++ test/sql/iproto.test.lua | 3 ++ test/sql/max-on-index.result | 6 ++++ test/sql/max-on-index.test.lua | 2 ++ test/sql/message-func-indexes.result | 6 ++++ test/sql/message-func-indexes.test.lua | 2 ++ test/sql/misc.result | 9 +++++ test/sql/misc.test.lua | 4 +++ test/sql/on-conflict.result | 6 ++++ test/sql/on-conflict.test.lua | 2 ++ test/sql/persistency.result | 6 ++++ test/sql/persistency.test.lua | 2 ++ test/sql/savepoints.result | 6 ++++ test/sql/savepoints.test.lua | 2 ++ test/sql/select-null.result | 6 ++++ test/sql/select-null.test.lua | 2 ++ test/sql/sql-statN-index-drop.result | 6 ++++ test/sql/sql-statN-index-drop.test.lua | 2 ++ test/sql/suite.ini | 1 + test/sql/tokenizer.result | 6 ++++ test/sql/tokenizer.test.lua | 2 ++ test/sql/transition.result | 9 +++++ test/sql/transition.test.lua | 4 +++ test/sql/transitive-transactions.result | 7 ++++ test/sql/transitive-transactions.test.lua | 3 ++ test/sql/triggers.result | 6 ++++ test/sql/triggers.test.lua | 2 ++ test/sql/update-with-nested-select.result | 6 ++++ test/sql/update-with-nested-select.test.lua | 2 ++ test/sql/upgrade.result | 6 ++++ test/sql/upgrade.test.lua | 2 ++ test/sql/view.result | 6 ++++ test/sql/view.test.lua | 2 ++ test/sql/view_delayed_wal.result | 6 ++++ test/sql/view_delayed_wal.test.lua | 2 ++ 79 files changed, 399 insertions(+), 3 deletions(-) create mode 100644 test/sql-tap/engine.cfg create mode 100644 test/sql/engine.cfg create mode 100644 test/sql/engine.result create mode 100644 test/sql/engine.test.lua diff --git a/test/sql-tap/analyze9.test.lua b/test/sql-tap/analyze9.test.lua index 3b3d52f..2034fa2 100755 --- a/test/sql-tap/analyze9.test.lua +++ b/test/sql-tap/analyze9.test.lua @@ -20,9 +20,11 @@ testprefix = "analyze9" -- functionality is working. -- +-- SQL Analyze is working correctly only with memtx now. test:do_execsql_test( 1.0, [[ + pragma sql_default_engine='memtx'; DROP TABLE IF EXISTS t1; CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT); INSERT INTO t1 VALUES('(0)', '(0)'); diff --git a/test/sql-tap/engine.cfg b/test/sql-tap/engine.cfg new file mode 100644 index 0000000..0007d8d --- /dev/null +++ b/test/sql-tap/engine.cfg @@ -0,0 +1,6 @@ +{ + "*": { + "memtx": {"engine": "memtx"}, + "vinyl": {"engine": "vinyl"} + } +} diff --git a/test/sql-tap/lua/sqltester.lua b/test/sql-tap/lua/sqltester.lua index 97c79f5..0413815 100644 --- a/test/sql-tap/lua/sqltester.lua +++ b/test/sql-tap/lua/sqltester.lua @@ -411,11 +411,18 @@ test.do_eqp_test = function (self, label, sql, result) end setmetatable(_G, nil) -os.execute("rm -f *.snap *.xlog*") +os.execute("rm -rf $(ls -d */)") +os.execute("rm -f *.snap *.xlog* *.vylog* *.run*") -- start the database box.cfg{ memtx_max_tuple_size=4996109; + vinyl_max_tuple_size=4996109; log="tarantool.log"; } + +test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') + return test diff --git a/test/sql-tap/suite.ini b/test/sql-tap/suite.ini index e259be2..16aaf5a 100644 --- a/test/sql-tap/suite.ini +++ b/test/sql-tap/suite.ini @@ -5,3 +5,4 @@ disabled = reindex.test.lua ; This test is banned in scope of #2174 lua_libs = lua/sqltester.lua ../sql/lua/sql_tokenizer.lua ../box/lua/identifier.lua is_parallel = True +config = engine.cfg \ No newline at end of file diff --git a/test/sql/app.lua b/test/sql/app.lua index 96bb590..8dbed1c 100644 --- a/test/sql/app.lua +++ b/test/sql/app.lua @@ -3,7 +3,8 @@ box.cfg{ listen = os.getenv("LISTEN"), pid_file = "tarantool.pid", - memtx_max_tuple_size = 5 * 1024 * 1024 + memtx_max_tuple_size = 5 * 1024 * 1024, + vinyl_max_tuple_size = 5 * 1024 * 1024, } require('console').listen(os.getenv('ADMIN')) diff --git a/test/sql/check-clear-ephemeral.result b/test/sql/check-clear-ephemeral.result index 156e06a..4ab1fe1 100644 --- a/test/sql/check-clear-ephemeral.result +++ b/test/sql/check-clear-ephemeral.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- box.cfg() -- create space box.sql.execute("CREATE TABLE t1(a,b,c,PRIMARY KEY(b,c));") diff --git a/test/sql/check-clear-ephemeral.test.lua b/test/sql/check-clear-ephemeral.test.lua index 8a5787b..c7ea733 100644 --- a/test/sql/check-clear-ephemeral.test.lua +++ b/test/sql/check-clear-ephemeral.test.lua @@ -1,5 +1,6 @@ test_run = require('test_run').new() - +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- box.cfg() -- create space diff --git a/test/sql/checks.result b/test/sql/checks.result index 21ce210..2a31b01 100644 --- a/test/sql/checks.result +++ b/test/sql/checks.result @@ -8,6 +8,12 @@ test_run:cmd("push filter ".."'\\.lua.*:[0-9]+: ' to '.lua...\"]:: '") --- - true ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- -- gh-3272: Move SQL CHECK into server -- diff --git a/test/sql/checks.test.lua b/test/sql/checks.test.lua index bb76b0c..7ff78fe 100644 --- a/test/sql/checks.test.lua +++ b/test/sql/checks.test.lua @@ -1,6 +1,8 @@ env = require('test_run') test_run = env.new() test_run:cmd("push filter ".."'\\.lua.*:[0-9]+: ' to '.lua...\"]:: '") +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- -- gh-3272: Move SQL CHECK into server diff --git a/test/sql/clear.result b/test/sql/clear.result index d267245..c75e134 100644 --- a/test/sql/clear.result +++ b/test/sql/clear.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- box.cfg() -- create space box.sql.execute("CREATE TABLE zoobar (c1, c2 PRIMARY KEY, c3, c4)") diff --git a/test/sql/clear.test.lua b/test/sql/clear.test.lua index 068a7c1..142cda8 100644 --- a/test/sql/clear.test.lua +++ b/test/sql/clear.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- box.cfg() diff --git a/test/sql/collation.result b/test/sql/collation.result index 3a4f81f..7fec96d 100644 --- a/test/sql/collation.result +++ b/test/sql/collation.result @@ -1,6 +1,15 @@ remote = require('net.box') --- ... +test_run = require('test_run').new() +--- +... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- gh-3010: COLLATE after LIMIT should throw an error -- All of these tests should throw error "near "COLLATE": syntax error" box.sql.execute("SELECT 1 LIMIT 1 COLLATE BINARY;") diff --git a/test/sql/collation.test.lua b/test/sql/collation.test.lua index fe8c1ba..ff2c5b2 100644 --- a/test/sql/collation.test.lua +++ b/test/sql/collation.test.lua @@ -1,4 +1,7 @@ remote = require('net.box') +test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- gh-3010: COLLATE after LIMIT should throw an error diff --git a/test/sql/delete-multiple-idx.result b/test/sql/delete-multiple-idx.result index 000dad2..a163cf1 100644 --- a/test/sql/delete-multiple-idx.result +++ b/test/sql/delete-multiple-idx.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- box.cfg() -- Create space. box.sql.execute("CREATE TABLE t3(id primary key,x,y);"); diff --git a/test/sql/delete-multiple-idx.test.lua b/test/sql/delete-multiple-idx.test.lua index 26c19a0..e187355 100644 --- a/test/sql/delete-multiple-idx.test.lua +++ b/test/sql/delete-multiple-idx.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- box.cfg() diff --git a/test/sql/delete.result b/test/sql/delete.result index b7dc588..c454c60 100644 --- a/test/sql/delete.result +++ b/test/sql/delete.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- box.cfg() -- create space box.sql.execute("CREATE TABLE t1(a, b, PRIMARY KEY(a, b));"); diff --git a/test/sql/delete.test.lua b/test/sql/delete.test.lua index 69d8ff9..2f6b625 100644 --- a/test/sql/delete.test.lua +++ b/test/sql/delete.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- box.cfg() diff --git a/test/sql/drop-index.result b/test/sql/drop-index.result index 9fa8b8b..2aaddac 100644 --- a/test/sql/drop-index.result +++ b/test/sql/drop-index.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- box.cfg() -- create space box.sql.execute("CREATE TABLE zzoobar (c1, c2 PRIMARY KEY, c3, c4)") diff --git a/test/sql/drop-index.test.lua b/test/sql/drop-index.test.lua index d39d33b..8bb51e1 100644 --- a/test/sql/drop-index.test.lua +++ b/test/sql/drop-index.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- box.cfg() diff --git a/test/sql/drop-table.result b/test/sql/drop-table.result index e891764..08f2496 100644 --- a/test/sql/drop-table.result +++ b/test/sql/drop-table.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- box.cfg() -- create space box.sql.execute("CREATE TABLE zzzoobar (c1, c2 PRIMARY KEY, c3, c4)") diff --git a/test/sql/drop-table.test.lua b/test/sql/drop-table.test.lua index a721563..9663074 100644 --- a/test/sql/drop-table.test.lua +++ b/test/sql/drop-table.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- box.cfg() diff --git a/test/sql/engine.cfg b/test/sql/engine.cfg new file mode 100644 index 0000000..0007d8d --- /dev/null +++ b/test/sql/engine.cfg @@ -0,0 +1,6 @@ +{ + "*": { + "memtx": {"engine": "memtx"}, + "vinyl": {"engine": "vinyl"} + } +} diff --git a/test/sql/engine.result b/test/sql/engine.result new file mode 100644 index 0000000..1b31e2f --- /dev/null +++ b/test/sql/engine.result @@ -0,0 +1,42 @@ +env = require('test_run') +--- +... +test_run = env.new() +--- +... +box.sql.execute("pragma sql_default_engine='vinyl'") +--- +... +box.sql.execute("CREATE TABLE t1_vinyl(a primary key,b,c);") +--- +... +box.sql.execute("CREATE TABLE t2_vinyl(a primary key,b,c);") +--- +... +box.sql.execute("pragma sql_default_engine='memtx'") +--- +... +box.sql.execute("CREATE TABLE t3_memtx(a primary key,b,c);") +--- +... +assert(box.space.T1_VINYL.engine == 'vinyl') +--- +- true +... +assert(box.space.T2_VINYL.engine == 'vinyl') +--- +- true +... +assert(box.space.T3_MEMTX.engine == 'memtx') +--- +- true +... +box.sql.execute("DROP TABLE t1_vinyl;") +--- +... +box.sql.execute("DROP TABLE t2_vinyl;") +--- +... +box.sql.execute("DROP TABLE t3_memtx;") +--- +... diff --git a/test/sql/engine.test.lua b/test/sql/engine.test.lua new file mode 100644 index 0000000..2a07c71 --- /dev/null +++ b/test/sql/engine.test.lua @@ -0,0 +1,17 @@ +env = require('test_run') +test_run = env.new() + +box.sql.execute("pragma sql_default_engine='vinyl'") +box.sql.execute("CREATE TABLE t1_vinyl(a primary key,b,c);") +box.sql.execute("CREATE TABLE t2_vinyl(a primary key,b,c);") + +box.sql.execute("pragma sql_default_engine='memtx'") +box.sql.execute("CREATE TABLE t3_memtx(a primary key,b,c);") + +assert(box.space.T1_VINYL.engine == 'vinyl') +assert(box.space.T2_VINYL.engine == 'vinyl') +assert(box.space.T3_MEMTX.engine == 'memtx') + +box.sql.execute("DROP TABLE t1_vinyl;") +box.sql.execute("DROP TABLE t2_vinyl;") +box.sql.execute("DROP TABLE t3_memtx;") diff --git a/test/sql/errinj.result b/test/sql/errinj.result index 1451ea1..b491d46 100644 --- a/test/sql/errinj.result +++ b/test/sql/errinj.result @@ -1,6 +1,15 @@ remote = require('net.box') --- ... +test_run = require('test_run').new() +--- +... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... errinj = box.error.injection --- ... diff --git a/test/sql/errinj.test.lua b/test/sql/errinj.test.lua index 5663a83..da25b03 100644 --- a/test/sql/errinj.test.lua +++ b/test/sql/errinj.test.lua @@ -1,4 +1,7 @@ remote = require('net.box') +test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') errinj = box.error.injection fiber = require('fiber') diff --git a/test/sql/gh-2929-primary-key.result b/test/sql/gh-2929-primary-key.result index 53896fc..c238ed7 100644 --- a/test/sql/gh-2929-primary-key.result +++ b/test/sql/gh-2929-primary-key.result @@ -1,3 +1,12 @@ +test_run = require('test_run').new() +--- +... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- All tables in SQL are now WITHOUT ROW ID, so if user -- tries to create table without a primary key, an appropriate error message -- should be raised. This tests checks it. diff --git a/test/sql/gh-2929-primary-key.test.lua b/test/sql/gh-2929-primary-key.test.lua index 27338a6..0a9395c 100644 --- a/test/sql/gh-2929-primary-key.test.lua +++ b/test/sql/gh-2929-primary-key.test.lua @@ -1,3 +1,7 @@ +test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') + -- All tables in SQL are now WITHOUT ROW ID, so if user -- tries to create table without a primary key, an appropriate error message -- should be raised. This tests checks it. diff --git a/test/sql/gh-2981-check-autoinc.result b/test/sql/gh-2981-check-autoinc.result index aaa0785..b0f55e6 100644 --- a/test/sql/gh-2981-check-autoinc.result +++ b/test/sql/gh-2981-check-autoinc.result @@ -1,3 +1,12 @@ +test_run = require('test_run').new() +--- +... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... box.cfg{} --- ... diff --git a/test/sql/gh-2981-check-autoinc.test.lua b/test/sql/gh-2981-check-autoinc.test.lua index f136505..98a5fb4 100644 --- a/test/sql/gh-2981-check-autoinc.test.lua +++ b/test/sql/gh-2981-check-autoinc.test.lua @@ -1,3 +1,7 @@ +test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') + box.cfg{} box.sql.execute("CREATE TABLE t1 (s1 INTEGER PRIMARY KEY AUTOINCREMENT, s2 INTEGER, CHECK (s1 <> 19));"); diff --git a/test/sql/gh-3199-no-mem-leaks.result b/test/sql/gh-3199-no-mem-leaks.result index 682ca62..9d715e8 100644 --- a/test/sql/gh-3199-no-mem-leaks.result +++ b/test/sql/gh-3199-no-mem-leaks.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... fiber = require('fiber') --- ... diff --git a/test/sql/gh-3199-no-mem-leaks.test.lua b/test/sql/gh-3199-no-mem-leaks.test.lua index d61d474..138166b 100644 --- a/test/sql/gh-3199-no-mem-leaks.test.lua +++ b/test/sql/gh-3199-no-mem-leaks.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') fiber = require('fiber') -- This test checks that no leaks of region memory happens during diff --git a/test/sql/gh2141-delete-trigger-drop-table.result b/test/sql/gh2141-delete-trigger-drop-table.result index ec5a380..d8ba2af 100644 --- a/test/sql/gh2141-delete-trigger-drop-table.result +++ b/test/sql/gh2141-delete-trigger-drop-table.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- create space box.sql.execute("CREATE TABLE t(id PRIMARY KEY)") --- diff --git a/test/sql/gh2141-delete-trigger-drop-table.test.lua b/test/sql/gh2141-delete-trigger-drop-table.test.lua index 87110a4..19d3188 100644 --- a/test/sql/gh2141-delete-trigger-drop-table.test.lua +++ b/test/sql/gh2141-delete-trigger-drop-table.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- create space box.sql.execute("CREATE TABLE t(id PRIMARY KEY)") diff --git a/test/sql/gh2251-multiple-update.result b/test/sql/gh2251-multiple-update.result index 5372cfc..5e137ee 100644 --- a/test/sql/gh2251-multiple-update.result +++ b/test/sql/gh2251-multiple-update.result @@ -2,6 +2,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- box.cfg() box.sql.execute("CREATE TABLE t1(a integer primary key, b UNIQUE, e);") --- diff --git a/test/sql/gh2251-multiple-update.test.lua b/test/sql/gh2251-multiple-update.test.lua index 15795f1..0166a17 100644 --- a/test/sql/gh2251-multiple-update.test.lua +++ b/test/sql/gh2251-multiple-update.test.lua @@ -1,5 +1,7 @@ -- Regression test for #2251 test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- box.cfg() diff --git a/test/sql/gh2483-remote-persistency-check.result b/test/sql/gh2483-remote-persistency-check.result index 5cb6db3..50e65f2 100644 --- a/test/sql/gh2483-remote-persistency-check.result +++ b/test/sql/gh2483-remote-persistency-check.result @@ -5,6 +5,12 @@ env = require('test_run') test_run = env.new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... box.schema.user.grant('guest', 'read,write,execute', 'universe') --- ... diff --git a/test/sql/gh2483-remote-persistency-check.test.lua b/test/sql/gh2483-remote-persistency-check.test.lua index da13e4e..b952f6b 100644 --- a/test/sql/gh2483-remote-persistency-check.test.lua +++ b/test/sql/gh2483-remote-persistency-check.test.lua @@ -1,6 +1,8 @@ -- Regression test for gh-2483 env = require('test_run') test_run = env.new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') box.schema.user.grant('guest', 'read,write,execute', 'universe') diff --git a/test/sql/gh2808-inline-unique-persistency-check.result b/test/sql/gh2808-inline-unique-persistency-check.result index e171f7a..fdd000f 100644 --- a/test/sql/gh2808-inline-unique-persistency-check.result +++ b/test/sql/gh2808-inline-unique-persistency-check.result @@ -5,6 +5,12 @@ env = require('test_run') test_run = env.new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- Create a table and insert a datum box.sql.execute([[CREATE TABLE t1(a PRIMARY KEY, b, UNIQUE(b));]]) --- diff --git a/test/sql/gh2808-inline-unique-persistency-check.test.lua b/test/sql/gh2808-inline-unique-persistency-check.test.lua index 19ae877..eb4e051 100644 --- a/test/sql/gh2808-inline-unique-persistency-check.test.lua +++ b/test/sql/gh2808-inline-unique-persistency-check.test.lua @@ -1,6 +1,8 @@ -- Regression test for gh-2483 env = require('test_run') test_run = env.new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- Create a table and insert a datum box.sql.execute([[CREATE TABLE t1(a PRIMARY KEY, b, UNIQUE(b));]]) diff --git a/test/sql/icu-upper-lower.result b/test/sql/icu-upper-lower.result index 9989ed2..6ca44b9 100644 --- a/test/sql/icu-upper-lower.result +++ b/test/sql/icu-upper-lower.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... test_run:cmd("setopt delimiter ';'") --- - true diff --git a/test/sql/icu-upper-lower.test.lua b/test/sql/icu-upper-lower.test.lua index bb1a518..6629a74 100644 --- a/test/sql/icu-upper-lower.test.lua +++ b/test/sql/icu-upper-lower.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') test_run:cmd("setopt delimiter ';'") diff --git a/test/sql/insert-unique.result b/test/sql/insert-unique.result index 7e564ec..048d628 100644 --- a/test/sql/insert-unique.result +++ b/test/sql/insert-unique.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- box.cfg() -- create space box.sql.execute("CREATE TABLE zoobar (c1, c2 PRIMARY KEY, c3, c4)") diff --git a/test/sql/insert-unique.test.lua b/test/sql/insert-unique.test.lua index dfdaa30..a004c57 100644 --- a/test/sql/insert-unique.test.lua +++ b/test/sql/insert-unique.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- box.cfg() diff --git a/test/sql/iproto.result b/test/sql/iproto.result index 3b7574a..4cf7901 100644 --- a/test/sql/iproto.result +++ b/test/sql/iproto.result @@ -1,6 +1,15 @@ remote = require('net.box') --- ... +test_run = require('test_run').new() +--- +... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... box.sql.execute('create table test (id primary key, a float, b text)') --- ... diff --git a/test/sql/iproto.test.lua b/test/sql/iproto.test.lua index 159a839..220331b 100644 --- a/test/sql/iproto.test.lua +++ b/test/sql/iproto.test.lua @@ -1,4 +1,7 @@ remote = require('net.box') +test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') box.sql.execute('create table test (id primary key, a float, b text)') space = box.space.TEST diff --git a/test/sql/max-on-index.result b/test/sql/max-on-index.result index afd4362..b107633 100644 --- a/test/sql/max-on-index.result +++ b/test/sql/max-on-index.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- box.cfg() -- create space -- scalar affinity diff --git a/test/sql/max-on-index.test.lua b/test/sql/max-on-index.test.lua index 5ce6cd7..b879e38 100644 --- a/test/sql/max-on-index.test.lua +++ b/test/sql/max-on-index.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- box.cfg() diff --git a/test/sql/message-func-indexes.result b/test/sql/message-func-indexes.result index 4bf1cab..37ed4ec 100644 --- a/test/sql/message-func-indexes.result +++ b/test/sql/message-func-indexes.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- Creating tables. box.sql.execute("CREATE TABLE t1(id INTEGER PRIMARY KEY, a INTEGER)") --- diff --git a/test/sql/message-func-indexes.test.lua b/test/sql/message-func-indexes.test.lua index 4597c9b..e0eae76 100644 --- a/test/sql/message-func-indexes.test.lua +++ b/test/sql/message-func-indexes.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- Creating tables. box.sql.execute("CREATE TABLE t1(id INTEGER PRIMARY KEY, a INTEGER)") diff --git a/test/sql/misc.result b/test/sql/misc.result index b1ddb89..93b383a 100644 --- a/test/sql/misc.result +++ b/test/sql/misc.result @@ -1,3 +1,12 @@ +test_run = require('test_run').new() +--- +... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- Forbid multistatement queries. box.sql.execute('select 1;') --- diff --git a/test/sql/misc.test.lua b/test/sql/misc.test.lua index 2c05fcd..1ed0198 100644 --- a/test/sql/misc.test.lua +++ b/test/sql/misc.test.lua @@ -1,3 +1,7 @@ +test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') + -- Forbid multistatement queries. box.sql.execute('select 1;') box.sql.execute('select 1; select 2;') diff --git a/test/sql/on-conflict.result b/test/sql/on-conflict.result index 9e15ec4..c0d0de0 100644 --- a/test/sql/on-conflict.result +++ b/test/sql/on-conflict.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- Create space box.sql.execute("CREATE TABLE t (id INTEGER PRIMARY KEY, v INTEGER UNIQUE ON CONFLICT ABORT)") --- diff --git a/test/sql/on-conflict.test.lua b/test/sql/on-conflict.test.lua index a6aa3d6..b6d92f7 100644 --- a/test/sql/on-conflict.test.lua +++ b/test/sql/on-conflict.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- Create space box.sql.execute("CREATE TABLE t (id INTEGER PRIMARY KEY, v INTEGER UNIQUE ON CONFLICT ABORT)") diff --git a/test/sql/persistency.result b/test/sql/persistency.result index 8f89039..e31d0bc 100644 --- a/test/sql/persistency.result +++ b/test/sql/persistency.result @@ -4,6 +4,12 @@ env = require('test_run') test_run = env.new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- create space box.sql.execute("CREATE TABLE foobar (foo PRIMARY KEY, bar)") --- diff --git a/test/sql/persistency.test.lua b/test/sql/persistency.test.lua index e994a62..417d8c0 100644 --- a/test/sql/persistency.test.lua +++ b/test/sql/persistency.test.lua @@ -1,5 +1,7 @@ env = require('test_run') test_run = env.new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- create space box.sql.execute("CREATE TABLE foobar (foo PRIMARY KEY, bar)") diff --git a/test/sql/savepoints.result b/test/sql/savepoints.result index e32c9b3..8553dd8 100644 --- a/test/sql/savepoints.result +++ b/test/sql/savepoints.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- These tests check that SQL savepoints properly work outside -- transactions as well as inside transactions started in Lua. -- gh-3313 diff --git a/test/sql/savepoints.test.lua b/test/sql/savepoints.test.lua index 2d87b9e..a4ed061 100644 --- a/test/sql/savepoints.test.lua +++ b/test/sql/savepoints.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- These tests check that SQL savepoints properly work outside -- transactions as well as inside transactions started in Lua. diff --git a/test/sql/select-null.result b/test/sql/select-null.result index a229eb9..53bef1b 100644 --- a/test/sql/select-null.result +++ b/test/sql/select-null.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- box.cfg() -- create space box.sql.execute("CREATE TABLE t3(id INT, a, b, PRIMARY KEY(id))") diff --git a/test/sql/select-null.test.lua b/test/sql/select-null.test.lua index a2c1266..3e9cb81 100644 --- a/test/sql/select-null.test.lua +++ b/test/sql/select-null.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- box.cfg() diff --git a/test/sql/sql-statN-index-drop.result b/test/sql/sql-statN-index-drop.result index c7e476f..a751eca 100644 --- a/test/sql/sql-statN-index-drop.result +++ b/test/sql/sql-statN-index-drop.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- Initializing some things. box.sql.execute("CREATE TABLE t1(id PRIMARY KEY, a);") --- diff --git a/test/sql/sql-statN-index-drop.test.lua b/test/sql/sql-statN-index-drop.test.lua index bf4a752..fe7e15b 100644 --- a/test/sql/sql-statN-index-drop.test.lua +++ b/test/sql/sql-statN-index-drop.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- Initializing some things. box.sql.execute("CREATE TABLE t1(id PRIMARY KEY, a);") diff --git a/test/sql/suite.ini b/test/sql/suite.ini index 5f28f23..4504731 100644 --- a/test/sql/suite.ini +++ b/test/sql/suite.ini @@ -3,6 +3,7 @@ core = tarantool description = sql tests script = app.lua use_unix_sockets = True +config = engine.cfg is_parallel = True lua_libs = lua/sql_tokenizer.lua release_disabled = errinj.test.lua view_delayed_wal.test.lua diff --git a/test/sql/tokenizer.result b/test/sql/tokenizer.result index 3868f6b..9e50b87 100644 --- a/test/sql/tokenizer.result +++ b/test/sql/tokenizer.result @@ -4,6 +4,12 @@ env = require('test_run') test_run = env.new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... sql_tokenizer = require('sql_tokenizer') --- ... diff --git a/test/sql/tokenizer.test.lua b/test/sql/tokenizer.test.lua index e368219..7a69d12 100644 --- a/test/sql/tokenizer.test.lua +++ b/test/sql/tokenizer.test.lua @@ -1,5 +1,7 @@ env = require('test_run') test_run = env.new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') sql_tokenizer = require('sql_tokenizer') diff --git a/test/sql/transition.result b/test/sql/transition.result index 7c4a2c8..70fb2db 100644 --- a/test/sql/transition.result +++ b/test/sql/transition.result @@ -1,3 +1,12 @@ +test_run = require('test_run').new() +--- +... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- create space box.sql.execute("CREATE TABLE foobar (foo PRIMARY KEY, bar)") --- diff --git a/test/sql/transition.test.lua b/test/sql/transition.test.lua index 50ee7f5..cae45aa 100644 --- a/test/sql/transition.test.lua +++ b/test/sql/transition.test.lua @@ -1,3 +1,7 @@ +test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') + -- create space box.sql.execute("CREATE TABLE foobar (foo PRIMARY KEY, bar)") diff --git a/test/sql/transitive-transactions.result b/test/sql/transitive-transactions.result index e617cf1..da618d2 100644 --- a/test/sql/transitive-transactions.result +++ b/test/sql/transitive-transactions.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute("pragma sql_default_engine=\'"..engine.."\'") +--- +... test_run:cmd("setopt delimiter ';'") --- - true @@ -105,6 +111,7 @@ box.space.PARENT:select(); - - [1, 1] ... box.sql.execute('PRAGMA defer_foreign_keys = 1;') +box.rollback() fk_defer(); --- ... diff --git a/test/sql/transitive-transactions.test.lua b/test/sql/transitive-transactions.test.lua index 718f951..f663bf6 100644 --- a/test/sql/transitive-transactions.test.lua +++ b/test/sql/transitive-transactions.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute("pragma sql_default_engine=\'"..engine.."\'") test_run:cmd("setopt delimiter ';'") -- These tests are aimed at checking transitive transactions @@ -56,6 +58,7 @@ fk_defer(); box.space.CHILD:select(); box.space.PARENT:select(); box.sql.execute('PRAGMA defer_foreign_keys = 1;') +box.rollback() fk_defer(); box.space.CHILD:select(); box.space.PARENT:select(); diff --git a/test/sql/triggers.result b/test/sql/triggers.result index 90aa8a9..dc0a2e5 100644 --- a/test/sql/triggers.result +++ b/test/sql/triggers.result @@ -4,6 +4,12 @@ env = require('test_run') test_run = env.new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- Get invariant part of the tuple; name and opts don't change. function immutable_part(data) local r = {} for i, l in pairs(data) do table.insert(r, {l.name, l.opts}) end return r end --- diff --git a/test/sql/triggers.test.lua b/test/sql/triggers.test.lua index 4c88137..e019c00 100644 --- a/test/sql/triggers.test.lua +++ b/test/sql/triggers.test.lua @@ -1,5 +1,7 @@ env = require('test_run') test_run = env.new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- Get invariant part of the tuple; name and opts don't change. function immutable_part(data) local r = {} for i, l in pairs(data) do table.insert(r, {l.name, l.opts}) end return r end diff --git a/test/sql/update-with-nested-select.result b/test/sql/update-with-nested-select.result index 419cebb..51825a2 100644 --- a/test/sql/update-with-nested-select.result +++ b/test/sql/update-with-nested-select.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- box.cfg() -- create space box.sql.execute("CREATE TABLE t1(a integer primary key, b UNIQUE, e);"); diff --git a/test/sql/update-with-nested-select.test.lua b/test/sql/update-with-nested-select.test.lua index 7b90968..f9f9b7a 100644 --- a/test/sql/update-with-nested-select.test.lua +++ b/test/sql/update-with-nested-select.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- box.cfg() diff --git a/test/sql/upgrade.result b/test/sql/upgrade.result index 6f7b115..5e7d851 100644 --- a/test/sql/upgrade.result +++ b/test/sql/upgrade.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... work_dir = 'sql/upgrade/1.10/' --- ... diff --git a/test/sql/upgrade.test.lua b/test/sql/upgrade.test.lua index 1619795..cd4dd3c 100644 --- a/test/sql/upgrade.test.lua +++ b/test/sql/upgrade.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') work_dir = 'sql/upgrade/1.10/' test_run:cmd('create server upgrade with script="sql/upgrade/upgrade.lua", workdir="' .. work_dir .. '"') diff --git a/test/sql/view.result b/test/sql/view.result index b033f19..62fbcee 100644 --- a/test/sql/view.result +++ b/test/sql/view.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... -- Verify that constraints on 'view' option are working. -- box.cfg() -- Create space and view. diff --git a/test/sql/view.test.lua b/test/sql/view.test.lua index 27f449f..1d73133 100644 --- a/test/sql/view.test.lua +++ b/test/sql/view.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') -- Verify that constraints on 'view' option are working. diff --git a/test/sql/view_delayed_wal.result b/test/sql/view_delayed_wal.result index 3b68eda..2e1047a 100644 --- a/test/sql/view_delayed_wal.result +++ b/test/sql/view_delayed_wal.result @@ -1,6 +1,12 @@ test_run = require('test_run').new() --- ... +engine = test_run:get_cfg('engine') +--- +... +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') +--- +... fiber = require('fiber') --- ... diff --git a/test/sql/view_delayed_wal.test.lua b/test/sql/view_delayed_wal.test.lua index cca75ad..62ab7d7 100644 --- a/test/sql/view_delayed_wal.test.lua +++ b/test/sql/view_delayed_wal.test.lua @@ -1,4 +1,6 @@ test_run = require('test_run').new() +engine = test_run:get_cfg('engine') +box.sql.execute('pragma sql_default_engine=\''..engine..'\'') fiber = require('fiber') -- View reference counters are incremented before firing -- 2.7.4