Skip to content

Commit

Permalink
test: remove functions to open and close SQL connection
Browse files Browse the repository at this point in the history
Part of #5464
Closes #5741

(cherry picked from commit a3cf076)
  • Loading branch information
ligurio authored and kyukhin committed Mar 2, 2021
1 parent f61de54 commit e2bf0b9
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 56 deletions.
1 change: 0 additions & 1 deletion test/sql-tap/aggnested.test.lua
Expand Up @@ -73,7 +73,6 @@ test:do_execsql_test("aggnested-1.4",
-- # http://www.mail-archive.com/sql-users@sql.org/msg70787.html
-- #
-- do_test aggnested-2.0 {
-- sql db2 :memory:
-- db2 eval {
-- CREATE TABLE t1 (A1 INTEGER NOT NULL,A2 INTEGER NOT NULL,A3 INTEGER NOT
-- NULL,A4 INTEGER NOT NULL,PRIMARY KEY(A1));
Expand Down
2 changes: 0 additions & 2 deletions test/sql-tap/autoinc.test.lua
Expand Up @@ -52,8 +52,6 @@ test:do_execsql_test(
-- test:do_test(
-- "autoinc-1.4",
-- function()
-- db("close")
-- sql("db", "test.db")
-- return test:execsql([[
-- SELECT * FROM _sequence;
-- ]])
Expand Down
2 changes: 0 additions & 2 deletions test/sql-tap/check.test.lua
Expand Up @@ -227,8 +227,6 @@ test:do_execsql_test(
-- </check-2.2>
})

--db("close")
--sql("db", "test.db")
test:do_execsql_test(
"check-2.3",
[[
Expand Down
2 changes: 0 additions & 2 deletions test/sql-tap/colname.test.lua
Expand Up @@ -435,8 +435,6 @@ test:do_execsql2_test(
test:do_test(
"colname-6.1",
function()
--db("close")
--sql("db", "test.db")
-- instead of reconnect to database
-- we are just turning settings to default state
test:execsql([[
Expand Down
5 changes: 0 additions & 5 deletions test/sql-tap/e_expr.test.lua
Expand Up @@ -2170,8 +2170,6 @@ test:do_test(
"def", "abc", "X"
-- </e_expr-15.1.4>
})
--db("close")
--sql("db", "test.db")
-- EVIDENCE-OF: R-22868-25880 The LIKE operator can be made case
-- sensitive using the case_sensitive_like pragma.
--
Expand Down Expand Up @@ -3245,9 +3243,6 @@ end
---------------------------------------------------------------------------
-- Test statements related to scalar sub-queries.
--
-- catch { db close }
-- forcedelete test.db
-- sql db test.db
test:catchsql "DROP TABLE t22;"
test:do_execsql_test(
"e_expr-35.0",
Expand Down
2 changes: 0 additions & 2 deletions test/sql-tap/eqp.test.lua
Expand Up @@ -754,8 +754,6 @@ if (0 > 0)
ANALYZE;
]])

--db("close")
--sql("db", "test.db")
test:do_eqp_test("7.4", "SELECT count(*) FROM t1", {
{0, 0, 0, "SCAN TABLE T1"}
})
Expand Down
2 changes: 0 additions & 2 deletions test/sql-tap/index4.test.lua
Expand Up @@ -58,8 +58,6 @@ test:do_execsql_test(

-- MUST_WORK_TEST limit memory
--soft_limit = sql_soft_heap_limit(50000)
--db("close")
--sql("db", "test.db")
--test:do_execsql_test(
-- 1.4,
-- [[
Expand Down
6 changes: 0 additions & 6 deletions test/sql-tap/misc1.test.lua
Expand Up @@ -1062,8 +1062,6 @@ test:do_catchsql_test(

-- # 2015-04-19: NULL pointer dereference on a corrupt schema
-- #
-- db close
-- sql db :memory:
-- do_execsql_test misc1-23.1 {
-- CREATE TABLE t1(x INT );
-- UPDATE sql_master SET sql='CREATE table t(d CHECK(T(#0)';
Expand All @@ -1074,9 +1072,7 @@ test:do_catchsql_test(
-- } {}
-- # 2015-04-19: Faulty assert() statement
-- #
-- db close
-- database_may_be_corrupt
-- sql db :memory:
-- do_catchsql_test misc1-23.2 {
-- CREATE TABLE t1(x INT UNIQUE);
-- UPDATE sql_master SET sql='CREATE TABLE IF not EXISTS t(c)';
Expand All @@ -1085,8 +1081,6 @@ test:do_catchsql_test(
-- ROLLBACK;
-- DROP TABLE F;
-- } {1 {no such table: F}}
-- db close
-- sql db :memory:
-- do_catchsql_test misc1-23.3 {
-- CREATE TABLE t1(x INT UNIQUE);
-- UPDATE sql_master SET sql='CREATE table y(a TEXT, a TEXT)';
Expand Down
1 change: 0 additions & 1 deletion test/sql-tap/misc5.test.lua
Expand Up @@ -308,7 +308,6 @@ test:do_test(
-- # schema.
-- #
-- do_test misc5-7.2 {
-- sql db2 :memory:
-- catchsql {
-- CREATE TABLE t1(x INT UNIQUE);
-- UPDATE sql_master SET sql='CREATE table t(o CHECK(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((;VALUES(o)';
Expand Down
2 changes: 0 additions & 2 deletions test/sql-tap/numcast.test.lua
Expand Up @@ -26,8 +26,6 @@ for _, enc in ipairs({"utf8"}) do
test:do_test(
"numcast-"..enc..".0",
function()
--db("close")
--sql("db", ":memory:")
--test:execsql("PRAGMA encoding='"..enc.."'")
local x = "utf8"--test:execsql("PRAGMA encoding")[1]
x = string.lower(x)
Expand Down
8 changes: 0 additions & 8 deletions test/sql-tap/sort.test.lua
Expand Up @@ -805,8 +805,6 @@ box.internal.sql_create_function("cksum", cksum)
---------------------------------------------------------------------------
--
for _ in X(0, "X!foreach", [=[["tn mmap_limit nWorker tmpstore coremutex fakeheap softheaplimit","\n 1 0 3 file true false 0\n 2 0 3 file true true 0\n 3 0 0 file true false 0\n 4 1000000 3 file true false 0\n 5 0 0 memory false true 0\n 6 0 0 file false true 1000000 \n 7 0 0 file false true 10000\n "]]=]) do
db("close")
sql_shutdown()
if coremutex then
sql_config("multithread")
else
Expand All @@ -815,7 +813,6 @@ box.internal.sql_create_function("cksum", cksum)
sql_initialize()
X(558, "X!cmd", [=[["sorter_test_fakeheap",["fakeheap"]]]=])
sql_soft_heap_limit(softheaplimit)
reset_db()
sql_test_control("sql_TESTCTRL_SORTER_MMAP", "db", mmap_limit)
test:execsql(string.format("PRAGMA temp_store = %s; PRAGMA threads = '%s'", tmpstore, nWorker))
local ten, one
Expand Down Expand Up @@ -870,15 +867,12 @@ box.internal.sql_create_function("cksum", cksum)

X(605, "X!cmd", [=[["sorter_test_fakeheap","0"]]=])
end
db("close")
sql_shutdown()
X(617, "X!cmd", [=[["set","t(0)","singlethread"]]=])
X(618, "X!cmd", [=[["set","t(1)","multithread"]]=])
X(619, "X!cmd", [=[["set","t(2)","serialized"]]=])
sql_config(X(620, "X!expr", [=[["t($sql_options(threadsafe))"]]=]))
sql_initialize()
sql_soft_heap_limit(0)
reset_db()
test:do_catchsql_test(
16.1,
[[
Expand All @@ -895,7 +889,6 @@ box.internal.sql_create_function("cksum", cksum)
-- </16.1>
})

reset_db()
test:do_catchsql_test(
16.2,
[[
Expand All @@ -912,7 +905,6 @@ box.internal.sql_create_function("cksum", cksum)
-- </16.2>
})

reset_db()
test:do_execsql_test(
17.1,
[[
Expand Down
6 changes: 0 additions & 6 deletions test/sql-tap/table.test.lua
Expand Up @@ -422,9 +422,6 @@ if (0 > 0)
test:do_test(
"table-5.2.2",
function()
db("close")
forcedelete("test.db")
sql("db", "test.db")
return test:execsql [[
CREATE TABLE t0(a,b);
CREATE INDEX t ON t0(a);
Expand All @@ -440,9 +437,6 @@ if (0 > 0)
-- </table-5.2.2>
})

db("close")
forcedelete("test.db")
sql("db", "test.db")
X(313, "X!cmd", [=[["Make","sure","an","EXPLAIN","does","not","really","create","a","new","table"]]=])
end
test:do_test(
Expand Down
1 change: 0 additions & 1 deletion test/sql-tap/tkt1443.test.lua
Expand Up @@ -50,7 +50,6 @@ test:plan(3)
test:do_test(
"tkt1443-1.0",
function()
--sql("db", ":memory:")
return test:execsql(string.format([[
CREATE TABLE Items(
itemId integer primary key,
Expand Down
18 changes: 2 additions & 16 deletions test/sql-tap/view.test.lua
Expand Up @@ -88,8 +88,6 @@ test:do_execsql_test(
test:do_test(
"view-1.3.1",
function()
--db("close")
--sql("db", "test.db")
return test:execsql [[
SELECT * FROM v1 ORDER BY a;
]]
Expand Down Expand Up @@ -502,14 +500,12 @@ test:do_execsql_test(
-- </view-7.1>
})

-- MUST_WORK_TEST db close problem
-- MUST_WORK_TEST
if (0 > 0)
then
test:do_test(
"view-7.2",
function()
db("close")
sql("db", "test.db")
return test:execsql [[
SELECT * FROM test;
]]
Expand Down Expand Up @@ -540,8 +536,6 @@ if (0 > 0)
test:do_test(
"view-7.4",
function()
db("close")
sql("db", "test.db")
return test:execsql [[
SELECT * FROM test;
]]
Expand Down Expand Up @@ -572,8 +566,6 @@ if (0 > 0)
test:do_test(
"view-7.6",
function()
db("close")
sql("db", "test.db")
return test:execsql [[
SELECT * FROM test;
]]
Expand All @@ -595,14 +587,12 @@ test:do_execsql_test(
-- </view-8.1>
})

-- MUST_WORK_TEST db close
-- MUST_WORK_TEST
if (0 > 0)
then
test:do_test(
"view-8.2",
function()
db("close")
sql("db", "test.db")
return test:execsql [[
SELECT * FROM v6 ORDER BY xyz;
]]
Expand Down Expand Up @@ -1068,8 +1058,6 @@ test:do_execsql_test(
if (0 > 0)
then
-- Ticket #d58ccbb3f1b"]],":"],"Prevent","Table.nRef","overflow.
--db("close")
--sql("db", ":memory:")
test:execsql([[
drop view v1;
drop view v2;
Expand Down Expand Up @@ -1120,8 +1108,6 @@ if (0 > 0)



--db("close")
--sql("db", ":memory:")
test:do_execsql_test(
"view-22.1",
[[
Expand Down

0 comments on commit e2bf0b9

Please sign in to comment.