From: imeevma@tarantool.org To: v.shpilevoy@tarantool.org Cc: tarantool-patches@freelists.org Subject: [tarantool-patches] [PATCH v6 7/7] sql: remove test gh-3733-pragma.test.lua Date: Thu, 21 Feb 2019 16:00:56 +0300 [thread overview] Message-ID: <d5e14fa205b18a577eaba0a0c3b9ffb1561eff48.1550753723.git.imeevma@gmail.com> (raw) In-Reply-To: <cover.1550753723.git.imeevma@gmail.com> --- test/sql-tap/gh-3733-pragma.test.lua | 166 ------------------------------- test/sql-tap/pragma.test.lua | 186 ++++++++++++++++++++++++++++++++++- 2 files changed, 182 insertions(+), 170 deletions(-) delete mode 100755 test/sql-tap/gh-3733-pragma.test.lua diff --git a/test/sql-tap/gh-3733-pragma.test.lua b/test/sql-tap/gh-3733-pragma.test.lua deleted file mode 100755 index 0f856aa..0000000 --- a/test/sql-tap/gh-3733-pragma.test.lua +++ /dev/null @@ -1,166 +0,0 @@ -#!/usr/bin/env tarantool -test = require("sqltester") - -test:plan(16) - ---- ---- Prerequisites ---- -test:do_execsql_test( - "pragma-0.1", - [[ - DROP TABLE IF EXISTS gh3733; - CREATE TABLE gh3733(id INT primary key, f float); - INSERT INTO gh3733 VALUES(1, 0.1), (2, 0.2), (3, 0.3); - CREATE INDEX IDX ON GH3733 (id); - ]], { - -}) - ---- ---- pragma query_only is not supported ---- -test:do_catchsql_test( - "pragma-1.1", - [[ - pragma query_only; - ]], { - 1, "Pragma 'QUERY_ONLY' does not exist" -}) - ---- ---- pragma read_uncommitted is not supported ---- -test:do_catchsql_test( - "pragma-2.1", - [[ - pragma read_uncommitted; - ]], { - 1, "Pragma 'READ_UNCOMMITTED' does not exist" -}) - ---- ---- pragma index_list returns three columns in a row ---- -test:do_execsql_test( - "pragma-3.1", - [[ - pragma index_list(gh3733) - ]], { - -- <pragma-3.1> - 0, 'pk_unnamed_GH3733_1', 1, 1, 'IDX', 0 - -- </pragma-3.1> -}) - ---- ---- pragma index_list returns an empty tuple for unknown table ---- -test:do_execsql_test( - "pragma-4.1", - [[ - pragma index_list(fufel); - ]], { - -- <pragma-4.1> - -- </pragma-4.1> -}) - ---- ---- pragma index_info returns an empty tuple for unknown index ---- -test:do_execsql_test( - "pragma-5.1", - [[ - pragma index_info(gh3733.IDX) - ]], { - -- <pragma-5.1> - 0, 0, 'ID', 0, 'BINARY', 'integer' - -- </pragma-5.1> -}) - -test:do_execsql_test( - "pragma-5.2", - [[ - pragma index_info(no_table); - ]], { - -- <pragma-5.2> - -- </pragma-5.2> -}) - -test:do_execsql_test( - "pragma-5.3", - [[ - pragma index_info(wrong_table.IDX); - ]], { - -- <pragma-5.3> - -- </pragma-5.3> -}) - -test:do_execsql_test( - "pragma-5.4", - [[ - pragma index_info(gh3733.wrong_index); - ]], { - -- <pragma-5.4> - -- </pragma-5.4> -}) - ---- ---- pragma sql_default_engine accepts string values and rejects IDs ---- -test:do_catchsql_test( - "pragma-7.1", - [[ - pragma sql_default_engine(the_engine); - ]], { - 1, "Illegal parameters, string value is expected" -}) -test:do_catchsql_test( - "pragma-7.2", - [[ - pragma sql_default_engine(THE_ENGINE); - ]], { - 1, "Illegal parameters, string value is expected" -}) -test:do_catchsql_test( - "pragma-7.3", - [[ - pragma sql_default_engine("THE_ENGINE"); - ]], { - 1, "Illegal parameters, string value is expected" -}) - -test:do_catchsql_test( - "pragma-7.4", - [[ - pragma sql_default_engine('THE_ENGINE'); - ]], { - 1, "Space engine 'THE_ENGINE' does not exist" -}) - -test:do_catchsql_test( - "pragma-7.5", - [[ - pragma sql_default_engine(memtx); - ]], { - 1, "Illegal parameters, string value is expected" -}) - -test:do_catchsql_test( - "pragma-7.6", - [[ - pragma sql_default_engine("memtx"); - ]], { - 1, "Illegal parameters, string value is expected" -}) - -test:do_execsql_test( - "pragma-7.7", - [[ - pragma sql_default_engine('memtx'); - ]], { - -- <pragma-7.7> - - -- </pragma-7.7> -}) - -test:finish_test() diff --git a/test/sql-tap/pragma.test.lua b/test/sql-tap/pragma.test.lua index 935cb96..975a0e9 100755 --- a/test/sql-tap/pragma.test.lua +++ b/test/sql-tap/pragma.test.lua @@ -1,7 +1,7 @@ #!/usr/bin/env tarantool test = require("sqltester") -test:plan(9) +test:plan(24) test:do_catchsql_test( "pragma-1.3", @@ -67,7 +67,7 @@ test:do_execsql_test( ]], { -- <pragma-3.1> 'vinyl' - -- <pragma-3.1> + -- </pragma-3.1> }) test:do_execsql_test( @@ -78,7 +78,7 @@ test:do_execsql_test( ]], { -- <pragma-3.2> 'memtx' - -- <pragma-3.2> + -- </pragma-3.2> }) -- Check that "PRAGMA case_sensitive_like" returns its status @@ -94,7 +94,185 @@ test:do_test( end, -- <pragma-3.3> 1 - -- <pragma-3.3> + -- </pragma-3.3> ) +-- +-- gh-3733: remove useless or obsolete pragmas +-- + +--- +--- Prerequisites +--- +test:execsql( + [[ + DROP TABLE IF EXISTS gh3733; + CREATE TABLE gh3733(id INT primary key, f float); + INSERT INTO gh3733 VALUES(1, 0.1), (2, 0.2), (3, 0.3); + CREATE INDEX IDX ON GH3733 (id); + ]]) + +--- +--- pragma query_only is not supported +--- +test:do_catchsql_test( + "pragma-4.1", + [[ + pragma query_only; + ]], { + -- <pragma-4.1> + 1, "Pragma 'QUERY_ONLY' does not exist" + -- </pragma-4.1> +}) + +--- +--- pragma read_uncommitted is not supported +--- +test:do_catchsql_test( + "pragma-5.1", + [[ + pragma read_uncommitted; + ]], { + -- <pragma-5.1> + 1, "Pragma 'READ_UNCOMMITTED' does not exist" + -- </pragma-5.1> +}) + +--- +--- pragma index_list returns three columns in a row +--- +test:do_execsql_test( + "pragma-6.1", + [[ + pragma index_list(gh3733) + ]], { + -- <pragma-6.1> + 0, 'pk_unnamed_GH3733_1', 1, 1, 'IDX', 0 + -- </pragma-6.1> +}) + +--- +--- pragma index_list returns an empty tuple for unknown table +--- +test:do_execsql_test( + "pragma-7.1", + [[ + pragma index_list(fufel); + ]], { + -- <pragma-7.1> + -- </pragma-7.1> +}) + +--- +--- pragma index_info returns an empty tuple for unknown index +--- +test:do_execsql_test( + "pragma-8.1", + [[ + pragma index_info(gh3733.IDX) + ]], { + -- <pragma-8.1> + 0, 0, 'ID', 0, 'BINARY', 'integer' + -- </pragma-8.1> +}) + +test:do_execsql_test( + "pragma-8.2", + [[ + pragma index_info(no_table); + ]], { + -- <pragma-8.2> + -- </pragma-8.2> +}) + +test:do_execsql_test( + "pragma-8.3", + [[ + pragma index_info(wrong_table.IDX); + ]], { + -- <pragma-8.3> + -- </pragma-8.3> +}) + +test:do_execsql_test( + "pragma-8.4", + [[ + pragma index_info(gh3733.wrong_index); + ]], { + -- <pragma-8.4> + -- </pragma-8.4> +}) + +--- +--- pragma sql_default_engine accepts string values and rejects IDs +--- +test:do_catchsql_test( + "pragma-9.1", + [[ + pragma sql_default_engine(the_engine); + ]], { + -- <pragma-9.1> + 1, "Illegal parameters, string value is expected" + -- </pragma-9.1> +}) + +test:do_catchsql_test( + "pragma-9.2", + [[ + pragma sql_default_engine(THE_ENGINE); + ]], { + -- <pragma-9.2> + 1, "Illegal parameters, string value is expected" + -- </pragma-9.2> +}) + +test:do_catchsql_test( + "pragma-9.3", + [[ + pragma sql_default_engine("THE_ENGINE"); + ]], { + -- <pragma-9.3> + 1, "Illegal parameters, string value is expected" + -- </pragma-9.3> +}) + +test:do_catchsql_test( + "pragma-9.4", + [[ + pragma sql_default_engine('THE_ENGINE'); + ]], { + -- <pragma-9.4> + 1, "Space engine 'THE_ENGINE' does not exist" + -- </pragma-9.4> +}) + +test:do_catchsql_test( + "pragma-9.5", + [[ + pragma sql_default_engine(memtx); + ]], { + -- <pragma-9.5> + 1, "Illegal parameters, string value is expected" + -- </pragma-9.5> +}) + +test:do_catchsql_test( + "pragma-9.6", + [[ + pragma sql_default_engine("memtx"); + ]], { + -- <pragma-9.6> + 1, "Illegal parameters, string value is expected" + -- </pragma-9.6> +}) + +test:do_execsql_test( + "pragma-9.7", + [[ + pragma sql_default_engine('memtx'); + ]], { + -- <pragma-9.7> + -- </pragma-9.7> +}) + test:finish_test() -- 2.7.4
next prev parent reply other threads:[~2019-02-21 13:00 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-02-21 13:00 [tarantool-patches] [PATCH v6 0/7] sql: set column types for EXPLAIN and PRAGMA imeevma 2019-02-21 13:00 ` [tarantool-patches] [PATCH v6 1/7] sql: remove unused macros from pragma.c and pragma.h imeevma 2019-02-21 13:00 ` [tarantool-patches] [PATCH v6 2/7] sql: fix "PRAGMA parser_trace" result imeevma 2019-02-21 13:00 ` [tarantool-patches] [PATCH v6 3/7] sql: Show currently set sql_default_engine imeevma 2019-02-21 15:52 ` [tarantool-patches] " Konstantin Osipov 2019-02-21 13:00 ` [tarantool-patches] [PATCH v6 4/7] sql: fix "PRAGMA case_sensitive_like" result imeevma 2019-02-21 13:00 ` [tarantool-patches] [PATCH v6 5/7] sql: get results of PRAGMA statement as result set imeevma 2019-02-21 13:00 ` [tarantool-patches] [PATCH v6 6/7] sql: set column types for EXPLAIN and PRAGMA imeevma 2019-02-21 13:00 ` imeevma [this message] 2019-02-25 11:59 ` [tarantool-patches] Re: [PATCH v6 0/7] " Vladislav Shpilevoy 2019-02-25 21:05 ` Imeev Mergen 2019-02-26 9:33 ` Vladislav Shpilevoy 2019-02-27 11:09 ` Kirill Yukhin
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=d5e14fa205b18a577eaba0a0c3b9ffb1561eff48.1550753723.git.imeevma@gmail.com \ --to=imeevma@tarantool.org \ --cc=tarantool-patches@freelists.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [tarantool-patches] [PATCH v6 7/7] sql: remove test gh-3733-pragma.test.lua' \ /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