From: Kirill Shcherbatov <kshcherbatov@tarantool.org> To: tarantool-patches@freelists.org Cc: v.shpilevoy@tarantool.org, Kirill Shcherbatov <kshcherbatov@tarantool.org> Subject: [tarantool-patches] [PATCH v1 2/2] sql: enable multi-engine tests for SQL Date: Wed, 20 Jun 2018 20:06:27 +0300 [thread overview] Message-ID: <f9f9ff1379b6037389c918a94336656633d0c3fc.1529513981.git.kshcherbatov@tarantool.org> (raw) In-Reply-To: <cover.1529513981.git.kshcherbatov@tarantool.org> In-Reply-To: <cover.1529513981.git.kshcherbatov@tarantool.org> 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/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 | 12 ++++++- test/sql/iproto.test.lua | 6 +++- 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 | 10 ++++++ test/sql/transitive-transactions.test.lua | 6 ++++ 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 ++ 74 files changed, 390 insertions(+), 3 deletions(-) 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/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...\"]:<line>: '") --- - 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...\"]:<line>: '") +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 b004270..8de7497 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 f559099..ad33c2b 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..92b7c2e 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)') --- ... @@ -500,7 +509,8 @@ cn:execute('select * from test where id = :1', {1}) - [1, 2, '3'] ... -- gh-2602 obuf_alloc breaks the tuple in different slabs -_ = space:replace{1, 1, string.rep('a', 4 * 1024 * 1024)} +-- 4 * 1024 * 1024 is higher than vinyl max tuple size +if engine ~= 'vinyl' then _ = space:replace{1, 1, string.rep('a', 4 * 1024 * 1024)} end --- ... res = cn:execute('select * from test') diff --git a/test/sql/iproto.test.lua b/test/sql/iproto.test.lua index 159a839..0da6d48 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 @@ -175,7 +178,8 @@ cn:execute('select $2, $1, $3', parameters) cn:execute('select * from test where id = :1', {1}) -- gh-2602 obuf_alloc breaks the tuple in different slabs -_ = space:replace{1, 1, string.rep('a', 4 * 1024 * 1024)} +-- 4 * 1024 * 1024 is higher than vinyl max tuple size +if engine ~= 'vinyl' then _ = space:replace{1, 1, string.rep('a', 4 * 1024 * 1024)} end res = cn:execute('select * from test') res.metadata box.sql.execute('drop table 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 d85d7cc..b3099ce 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 272a25a..1cced76 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 @@ -104,7 +110,11 @@ box.space.PARENT:select(); --- - - [1, 1] ... +-- vinyl doesn't rollback failed transactions box.sql.execute('PRAGMA defer_foreign_keys = 1;') +if engine == 'vinyl' then + box.rollback() +end fk_defer(); --- ... diff --git a/test/sql/transitive-transactions.test.lua b/test/sql/transitive-transactions.test.lua index 303ecad..743d898 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,10 @@ fk_defer(); box.space.CHILD:select(); box.space.PARENT:select(); box.sql.execute('PRAGMA defer_foreign_keys = 1;') +-- vinyl doesn't rollback failed transactions +if engine == 'vinyl' then + box.rollback() +end fk_defer(); box.space.CHILD:select(); box.space.PARENT:select(); diff --git a/test/sql/triggers.result b/test/sql/triggers.result index 090b546..8d307d1 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 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 8e3f0c5..41aaba9 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 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 c65a7e5..eef7fb1 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 8c30fc6..cf0bd38 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
next prev parent reply other threads:[~2018-06-20 17:06 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-06-20 17:06 [tarantool-patches] [PATCH v1 0/2] sql: default engine pragma Kirill Shcherbatov 2018-06-20 17:06 ` [tarantool-patches] [PATCH v1 1/2] sql: introduce pragma sql_default_engine Kirill Shcherbatov 2018-06-22 20:04 ` [tarantool-patches] " Vladislav Shpilevoy 2018-06-26 12:22 ` Kirill Shcherbatov 2018-06-26 13:34 ` Vladislav Shpilevoy 2018-06-26 17:09 ` Kirill Shcherbatov 2018-06-27 12:32 ` Vladislav Shpilevoy 2018-06-27 15:59 ` Kirill Shcherbatov 2018-06-20 17:06 ` Kirill Shcherbatov [this message] 2018-06-22 20:04 ` [tarantool-patches] Re: [PATCH v1 2/2] sql: enable multi-engine tests for SQL Vladislav Shpilevoy 2018-06-26 12:22 ` Kirill Shcherbatov 2018-06-26 13:34 ` Vladislav Shpilevoy 2018-06-26 17:09 ` Kirill Shcherbatov 2018-06-26 12:23 ` [tarantool-patches] [PATCH v1 2/3] sql: fix SQL Count for vinyl engine Kirill Shcherbatov 2018-06-28 15:35 ` [tarantool-patches] Re: [PATCH v1 0/2] sql: default engine pragma Vladislav Shpilevoy 2018-06-28 16:00 ` n.pettik
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=f9f9ff1379b6037389c918a94336656633d0c3fc.1529513981.git.kshcherbatov@tarantool.org \ --to=kshcherbatov@tarantool.org \ --cc=tarantool-patches@freelists.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [tarantool-patches] [PATCH v1 2/2] sql: enable multi-engine tests for SQL' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox