[Tarantool-patches] [PATCH v8 04/14] test: fix luacheck warnings W211 in test/sql-tap

sergeyb at tarantool.org sergeyb at tarantool.org
Thu Jan 21 15:49:59 MSK 2021


From: Sergey Bronnikov <sergeyb at tarantool.org>

W211 (Unused local variable)

Part of #5464

test: fix luacheck warnings W111 in test/sql-tap
---
 .luacheckrc                                      |  2 --
 test/sql-tap/analyze3.test.lua                   |  2 --
 test/sql-tap/analyze5.test.lua                   | 16 ----------------
 test/sql-tap/analyze6.test.lua                   |  2 --
 test/sql-tap/analyze8.test.lua                   |  2 --
 test/sql-tap/analyze9.test.lua                   |  2 --
 test/sql-tap/analyzeC.test.lua                   |  3 ---
 test/sql-tap/analyzeD.test.lua                   |  2 --
 test/sql-tap/analyzeE.test.lua                   |  2 --
 test/sql-tap/analyzeF.test.lua                   |  2 --
 test/sql-tap/check.test.lua                      |  2 +-
 test/sql-tap/colname.test.lua                    |  2 +-
 test/sql-tap/count.test.lua                      |  1 -
 test/sql-tap/date.test.lua                       |  1 -
 test/sql-tap/delete4.test.lua                    |  2 +-
 test/sql-tap/distinct.test.lua                   |  1 -
 test/sql-tap/e_expr.test.lua                     |  5 ++---
 test/sql-tap/e_select1.test.lua                  |  4 +---
 test/sql-tap/eqp.test.lua                        |  2 --
 test/sql-tap/func.test.lua                       | 11 ++---------
 test/sql-tap/gh2250-trigger-chain-limit.test.lua |  1 -
 test/sql-tap/in3.test.lua                        |  2 +-
 test/sql-tap/in5.test.lua                        |  1 -
 test/sql-tap/index1.test.lua                     |  1 -
 test/sql-tap/index4.test.lua                     |  1 -
 test/sql-tap/insert1.test.lua                    |  1 -
 test/sql-tap/limit.test.lua                      |  1 -
 test/sql-tap/lua/sqltester.lua                   |  1 -
 test/sql-tap/misc1.test.lua                      | 11 -----------
 test/sql-tap/misc3.test.lua                      |  1 -
 test/sql-tap/orderby1.test.lua                   |  2 +-
 test/sql-tap/orderby2.test.lua                   |  2 +-
 test/sql-tap/orderby3.test.lua                   |  2 +-
 test/sql-tap/orderby4.test.lua                   |  2 +-
 test/sql-tap/orderby5.test.lua                   |  2 +-
 test/sql-tap/orderby6.test.lua                   |  2 +-
 test/sql-tap/orderby8.test.lua                   |  1 -
 test/sql-tap/orderby9.test.lua                   |  1 -
 test/sql-tap/select4.test.lua                    |  2 +-
 test/sql-tap/select5.test.lua                    |  2 +-
 test/sql-tap/select6.test.lua                    |  4 +---
 test/sql-tap/select7.test.lua                    |  1 -
 test/sql-tap/select9.test.lua                    |  8 ++------
 test/sql-tap/selectA.test.lua                    |  5 -----
 test/sql-tap/selectF.test.lua                    |  1 -
 test/sql-tap/selectG.test.lua                    |  2 --
 test/sql-tap/sort.test.lua                       |  2 --
 test/sql-tap/subquery2.test.lua                  |  2 --
 test/sql-tap/tkt-385a5b56b9.test.lua             |  1 -
 test/sql-tap/tkt-38cb5df375.test.lua             |  1 -
 test/sql-tap/tkt-3a77c9714e.test.lua             |  2 --
 test/sql-tap/tkt-4dd95f6943.test.lua             |  1 -
 test/sql-tap/tkt-4ef7e3cfca.test.lua             |  1 -
 test/sql-tap/tkt-54844eea3f.test.lua             |  1 -
 test/sql-tap/tkt-7bbfb7d442.test.lua             |  1 -
 test/sql-tap/tkt-80ba201079.test.lua             |  1 -
 test/sql-tap/tkt-8c63ff0ec.test.lua              |  1 -
 test/sql-tap/tkt-91e2e8ba6f.test.lua             |  1 -
 test/sql-tap/tkt-9a8b09f8e6.test.lua             |  1 -
 test/sql-tap/tkt-a8a0d2996a.test.lua             |  1 -
 test/sql-tap/tkt-b1d3a2e531.test.lua             |  3 ---
 test/sql-tap/tkt-b75a9ca6b0.test.lua             |  1 -
 test/sql-tap/tkt-ba7cbfaedc.test.lua             |  1 -
 test/sql-tap/tkt-bd484a090c.test.lua             |  1 -
 test/sql-tap/tkt-d635236375.test.lua             |  1 -
 test/sql-tap/trigger1.test.lua                   |  2 --
 test/sql-tap/trigger9.test.lua                   |  2 --
 test/sql-tap/triggerA.test.lua                   |  1 -
 test/sql-tap/triggerC.test.lua                   |  1 -
 test/sql-tap/types.test.lua                      |  1 -
 test/sql-tap/where2.test.lua                     | 13 -------------
 test/sql-tap/where4.test.lua                     |  2 --
 test/sql-tap/whereC.test.lua                     |  2 --
 test/sql-tap/whereD.test.lua                     |  1 -
 test/sql-tap/whereF.test.lua                     |  1 -
 test/sql-tap/whereG.test.lua                     |  1 -
 test/sql-tap/whereI.test.lua                     |  1 -
 test/sql-tap/whereK.test.lua                     |  1 -
 test/sql-tap/with1.test.lua                      |  1 -
 test/sql-tap/with2.test.lua                      |  1 -
 80 files changed, 20 insertions(+), 161 deletions(-)

diff --git a/.luacheckrc b/.luacheckrc
index eb709d6a3..9098d7112 100644
--- a/.luacheckrc
+++ b/.luacheckrc
@@ -51,8 +51,6 @@ exclude_files = {
 
 files["test/sql-tap/**/*.lua"] = {
     ignore = {
-        -- Unused local variable.
-        "211",
         -- Unused argument.
         "212",
         -- Unused loop variable.
diff --git a/test/sql-tap/analyze3.test.lua b/test/sql-tap/analyze3.test.lua
index c36cfc83b..5f0b24fea 100755
--- a/test/sql-tap/analyze3.test.lua
+++ b/test/sql-tap/analyze3.test.lua
@@ -2,8 +2,6 @@
 local test = require("sqltester")
 test:plan(37)
 
-local testprefix = "analyze3"
-
 --!./tcltestrunner.lua
 -- 2009 August 06
 --
diff --git a/test/sql-tap/analyze5.test.lua b/test/sql-tap/analyze5.test.lua
index 1d6665ad0..d53648919 100755
--- a/test/sql-tap/analyze5.test.lua
+++ b/test/sql-tap/analyze5.test.lua
@@ -21,22 +21,6 @@ local json = require("json")
 -- with many repeated values and only a few distinct values.
 --
 
-local testprefix = "analyze5"
-local function eqp(sql)
-    return test:execsql("EXPLAIN QUERY PLAN"..sql)
-end
-
-local function alpha(blob)
-    local ret = ""
-    for _, c in ipairs(X(37, "X!cmd", [=[["split",["blob"],""]]=])) do
-        if X(39, "X!cmd", [=[["string","is","alpha",["c"]]]=])
- then
-            ret = ret .. c
-        end
-    end
-    return ret
-end
-
 -- db("func", "alpha", "alpha")
 -- db("func", "lindex", "lindex")
 -- ["unset","-nocomplain","i","t","u","v","w","x","y","z"]
diff --git a/test/sql-tap/analyze6.test.lua b/test/sql-tap/analyze6.test.lua
index 5ec40d22b..07e8aff4b 100755
--- a/test/sql-tap/analyze6.test.lua
+++ b/test/sql-tap/analyze6.test.lua
@@ -21,8 +21,6 @@ test:plan(13)
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
 
-local testprefix = "analyze6"
-
 test:do_test(
     "analyze6-1.0",
     function()
diff --git a/test/sql-tap/analyze8.test.lua b/test/sql-tap/analyze8.test.lua
index 5c80a7b2f..cf40ce7bb 100755
--- a/test/sql-tap/analyze8.test.lua
+++ b/test/sql-tap/analyze8.test.lua
@@ -18,8 +18,6 @@ test:plan(15)
 -- in this file is testing the capabilities of sql_stat3.
 --
 
-local testprefix = "analyze8"
-
 -- Scenario:
 --
 --    Two indices.  One has mostly singleton entries, but for a few
diff --git a/test/sql-tap/analyze9.test.lua b/test/sql-tap/analyze9.test.lua
index 1d7c8b632..775b02587 100755
--- a/test/sql-tap/analyze9.test.lua
+++ b/test/sql-tap/analyze9.test.lua
@@ -2,8 +2,6 @@
 local test = require("sqltester")
 test:plan(121)
 
-local testprefix = "analyze9"
-
 --!./tcltestrunner.lua
 -- 2013 August 3
 --
diff --git a/test/sql-tap/analyzeC.test.lua b/test/sql-tap/analyzeC.test.lua
index baae809a6..1f303a9ce 100755
--- a/test/sql-tap/analyzeC.test.lua
+++ b/test/sql-tap/analyzeC.test.lua
@@ -2,9 +2,6 @@
 local test = require("sqltester")
 test:plan(20)
 
-local testprefix = "analyzeC"
-
-
 --!./tcltestrunner.lua
 -- 2014-07-22
 --
diff --git a/test/sql-tap/analyzeD.test.lua b/test/sql-tap/analyzeD.test.lua
index 579cb350a..12722a3d4 100755
--- a/test/sql-tap/analyzeD.test.lua
+++ b/test/sql-tap/analyzeD.test.lua
@@ -2,8 +2,6 @@
 local test = require("sqltester")
 test:plan(15)
 
-local testprefix = "analyzeD"
-
 --!./tcltestrunner.lua
 -- 2005 July 22
 --
diff --git a/test/sql-tap/analyzeE.test.lua b/test/sql-tap/analyzeE.test.lua
index 2da0c885f..22257f642 100755
--- a/test/sql-tap/analyzeE.test.lua
+++ b/test/sql-tap/analyzeE.test.lua
@@ -2,8 +2,6 @@
 local test = require("sqltester")
 test:plan(48)
 
-local testprefix = "analyzeE"
-
 --!./tcltestrunner.lua
 -- 2014-10-08
 --
diff --git a/test/sql-tap/analyzeF.test.lua b/test/sql-tap/analyzeF.test.lua
index e56437902..19bb2176f 100755
--- a/test/sql-tap/analyzeF.test.lua
+++ b/test/sql-tap/analyzeF.test.lua
@@ -2,8 +2,6 @@
 local test = require("sqltester")
 test:plan(18)
 
-local testprefix = "analyzeF"
-
 --!./tcltestrunner.lua
 -- 2015-03-12
 --
diff --git a/test/sql-tap/check.test.lua b/test/sql-tap/check.test.lua
index 6ecfedeb8..f8dcb7f7b 100755
--- a/test/sql-tap/check.test.lua
+++ b/test/sql-tap/check.test.lua
@@ -19,7 +19,7 @@ test:plan(61)
 -- $Id: check.test,v 1.13 2009/06/05 17:09:12 drh Exp $
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "check"
+
 -- Only run these tests if the build includes support for CHECK constraints
 
 
diff --git a/test/sql-tap/colname.test.lua b/test/sql-tap/colname.test.lua
index 44fa4cf89..dd93eed21 100755
--- a/test/sql-tap/colname.test.lua
+++ b/test/sql-tap/colname.test.lua
@@ -35,7 +35,7 @@ test:plan(79)
 --
 -- Verify the default settings for full_column_name
 --
-local function lreplace(arr, pos, len, val)
+local function lreplace(arr, pos, len, val) -- luacheck: no unused
     for i = pos + 1, pos + len + 1, 1 do
         arr[i] = val
     end
diff --git a/test/sql-tap/count.test.lua b/test/sql-tap/count.test.lua
index 9f4d759b5..d019105f9 100755
--- a/test/sql-tap/count.test.lua
+++ b/test/sql-tap/count.test.lua
@@ -105,7 +105,6 @@ for _, zIndex in ipairs(queries) do
         })
 
 end
-local json = require("json")
 local function uses_op_count(sql)
     if test:lsearch(test:execsql("EXPLAIN "..sql), "Count")>0 then
         return 1
diff --git a/test/sql-tap/date.test.lua b/test/sql-tap/date.test.lua
index b414b5397..fe5150719 100755
--- a/test/sql-tap/date.test.lua
+++ b/test/sql-tap/date.test.lua
@@ -40,7 +40,6 @@ local function datetest(tnum, expr, result)
         result)
 end
 
-local tcl_precision = 15
 datetest(1.1, "julianday('2000-01-01')", "2451544.5")
 datetest(1.2, "julianday('1970-01-01')", "2440587.5")
 datetest(1.3, "julianday('1910-04-20')", "2418781.5")
diff --git a/test/sql-tap/delete4.test.lua b/test/sql-tap/delete4.test.lua
index 43585e603..14bdac151 100755
--- a/test/sql-tap/delete4.test.lua
+++ b/test/sql-tap/delete4.test.lua
@@ -18,7 +18,7 @@ test:plan(14)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "delete4"
+
 test:do_execsql_test(
     1.1,
     [[
diff --git a/test/sql-tap/distinct.test.lua b/test/sql-tap/distinct.test.lua
index 02fe8a426..3b5bf550c 100755
--- a/test/sql-tap/distinct.test.lua
+++ b/test/sql-tap/distinct.test.lua
@@ -19,7 +19,6 @@ test:plan(56)
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
 
-local testprefix = "distinct"
 local function is_distinct_noop(sql)
     local sql1 = sql
     local sql2 = string.gsub(sql, "DISTINCT", "")
diff --git a/test/sql-tap/e_expr.test.lua b/test/sql-tap/e_expr.test.lua
index 81b08e223..f29b26175 100755
--- a/test/sql-tap/e_expr.test.lua
+++ b/test/sql-tap/e_expr.test.lua
@@ -1080,7 +1080,6 @@ if (0>0) then
     local function parameter_test(tn, sql, params, result)
         local stmt = sql_prepare_v2("db", sql, -1)
         for _ in X(0, "X!foreach", [=[["number name",["params"]]]=]) do
-            local nm = sql_bind_parameter_name(stmt, number)
             X(480, "X!cmd", [=[["do_test",[["tn"],".name.",["number"]],[["list","set","",["nm"]]],["name"]]]=])
             sql_bind_int(stmt, number, ((-1) * number))
         end
@@ -1089,7 +1088,7 @@ if (0>0) then
         for _ in X(0, "X!for", [=[["set i 0","$i < [sql_column_count $stmt]","incr i"]]=]) do
             table.insert(res,sql_column_text(stmt, i))
         end
-        local rc = sql_finalize(stmt)
+        sql_finalize(stmt)
         X(491, "X!cmd", [=[["do_test",[["tn"],".rc"],[["list","set","",["rc"]]],"sql_OK"]]=])
         X(492, "X!cmd", [=[["do_test",[["tn"],".res"],[["list","set","",["res"]]],["result"]]]=])
     end
@@ -1400,7 +1399,7 @@ for _, val in ipairs(test_cases12) do
         test:do_test(
             string.format("e_expr-12.3.%s.%s", tn, x),
             function()
-                local rc, err = pcall( function()
+                local rc = pcall( function()
                     test:execsql("SELECT "..e.." FROM tblname")
                 end)
                 return rc
diff --git a/test/sql-tap/e_select1.test.lua b/test/sql-tap/e_select1.test.lua
index 2a189582d..66eaa5339 100755
--- a/test/sql-tap/e_select1.test.lua
+++ b/test/sql-tap/e_select1.test.lua
@@ -970,7 +970,7 @@ for _ in X(0, "X!foreach", [=[["tn select","\n  8.1  \"SELECT count(*) FROM a1\"
  do
         nRow = nRow + 1
     end
-    local rc = sql_finalize(stmt)
+    sql_finalize(stmt)
     -- Test that $nRow==1 and that statement execution was successful
     -- (rc==sql_OK).
     X(983, "X!cmd", [=[["do_test",["e_select-4.",["tn"]],[["list","list",["rc"],["nRow"]]],"sql_OK 1"]]=])
@@ -1421,7 +1421,6 @@ data = {
     {23, "SELECT * FROM j1 INTERSECT SELECT * FROM j2,j3 LIMIT 10 OFFSET 5"},
     {24, "SELECT a FROM j1 INTERSECT SELECT g FROM j2,j3 LIMIT (SELECT 10)"}
 }
-local json = require("json")
 for _, val in ipairs(data) do
     local tn = val[1]
     local select = val[2]
@@ -2165,7 +2164,6 @@ for _, val in ipairs({
     {"5", "SELECT b FROM f1 ORDER BY a LIMIT (SELECT group_concat(b) FROM f1)"}}) do
     local tn = val[1]
     local select = val[2]
-    local err_param = val[3]
     test:do_catchsql_test(
         "e_select-9.2."..tn,
         select,
diff --git a/test/sql-tap/eqp.test.lua b/test/sql-tap/eqp.test.lua
index 6f08ca089..bc46a920e 100755
--- a/test/sql-tap/eqp.test.lua
+++ b/test/sql-tap/eqp.test.lua
@@ -17,8 +17,6 @@ test:plan(70)
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
 
-
-local testprefix = "eqp"
 ---------------------------------------------------------------------------
 --
 -- eqp-1.*:        Assorted tests.
diff --git a/test/sql-tap/func.test.lua b/test/sql-tap/func.test.lua
index d14eef421..4229b0098 100755
--- a/test/sql-tap/func.test.lua
+++ b/test/sql-tap/func.test.lua
@@ -18,7 +18,7 @@ test:plan(14694)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "func"
+
 -- Create a table to work with.
 --
 test:do_test(
@@ -1048,7 +1048,7 @@ test:do_execsql_test(
 --
 -- MUST_WORK_TEST testfunc not implemented
 if 0 > 0 then
-local DB = sql_connection_pointer("db")
+sql_connection_pointer("db")
 X(525, "X!cmd", [=[["sql_register_test_function",["::DB"],"testfunc"]]=])
 test:do_catchsql_test(
     "func-10.1",
@@ -1349,7 +1349,6 @@ test:do_execsql_test(
         -- </13.8.3>
     })
 
-local V = "one"
 test:do_execsql_test(
     "13.8.4",
     [[
@@ -1360,7 +1359,6 @@ test:do_execsql_test(
         -- </13.8.4>
     })
 
-V = "two"
 test:do_execsql_test(
     "13.8.5",
     [[
@@ -1372,7 +1370,6 @@ test:do_execsql_test(
     })
 
 db("cache", "flush")
-V = "three"
 test:do_execsql_test(
     "13.8.6",
     [[
@@ -1473,10 +1470,6 @@ test:do_test(
 test:do_test(
     "func-17.1",
     function()
-        local function testfunc1(args)
-            X(768, "X!cmd", [=[["error","Error %d with %s percents %p"]]=])
-        end
-
         db("function", "testfunc1", "::testfunc1")
         return test:catchsql([[
             SELECT testfunc1(1,2,3);
diff --git a/test/sql-tap/gh2250-trigger-chain-limit.test.lua b/test/sql-tap/gh2250-trigger-chain-limit.test.lua
index d3e90539a..46f80cd9a 100755
--- a/test/sql-tap/gh2250-trigger-chain-limit.test.lua
+++ b/test/sql-tap/gh2250-trigger-chain-limit.test.lua
@@ -74,7 +74,6 @@ for _, table_count in ipairs({30, 31}) do
     end
 
     local function check(sql)
-        local msg = ''
         local _, msg = pcall(function () test:execsql(sql) end)
         msg = tostring(msg)
         test:do_test(sql,
diff --git a/test/sql-tap/in3.test.lua b/test/sql-tap/in3.test.lua
index 7358f0a20..1dcf7c8e3 100755
--- a/test/sql-tap/in3.test.lua
+++ b/test/sql-tap/in3.test.lua
@@ -26,7 +26,7 @@ test:plan(28)
 -- Return the number of OpenEphemeral instructions used in the
 -- implementation of the sql statement passed as a an argument.
 --
-local function nEphemeral(sql)
+local function nEphemeral(sql) -- luacheck: no unused
     local nEph = 0
     for _, op in ipairs(test:execsql("EXPLAIN "..sql.."")) do
         if (op == "OpenTEphemeral")
diff --git a/test/sql-tap/in5.test.lua b/test/sql-tap/in5.test.lua
index a4972fc10..e441437c7 100755
--- a/test/sql-tap/in5.test.lua
+++ b/test/sql-tap/in5.test.lua
@@ -16,7 +16,6 @@ test:plan(22)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "in5"
 test:do_execsql_test(
     "in5-1.1",
     [[
diff --git a/test/sql-tap/index1.test.lua b/test/sql-tap/index1.test.lua
index 574faafd6..1ac02d60c 100755
--- a/test/sql-tap/index1.test.lua
+++ b/test/sql-tap/index1.test.lua
@@ -106,7 +106,6 @@ test:do_test(
 test:do_test(
     "index-2.2",
     function()
-        local msg
         local v , msg= pcall(function()
             test:execsql("CREATE INDEX index1 ON test1(f1, f2, f4, f3)")
             end)
diff --git a/test/sql-tap/index4.test.lua b/test/sql-tap/index4.test.lua
index 1019e0c89..cdc975e12 100755
--- a/test/sql-tap/index4.test.lua
+++ b/test/sql-tap/index4.test.lua
@@ -18,7 +18,6 @@ test:plan(7)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "index4"
 test:do_execsql_test(
     1.1,
     [[
diff --git a/test/sql-tap/insert1.test.lua b/test/sql-tap/insert1.test.lua
index 75dbe92b0..094fae0e9 100755
--- a/test/sql-tap/insert1.test.lua
+++ b/test/sql-tap/insert1.test.lua
@@ -1,6 +1,5 @@
 #!/usr/bin/env tarantool
 local test = require("sqltester")
-local yaml = require('yaml')
 test:plan(28)
 
 --!./tcltestrunner.lua
diff --git a/test/sql-tap/limit.test.lua b/test/sql-tap/limit.test.lua
index 4871e43db..a1b24ab19 100755
--- a/test/sql-tap/limit.test.lua
+++ b/test/sql-tap/limit.test.lua
@@ -694,7 +694,6 @@ test:do_catchsql_test(
 test:do_test(
     "limit-10.1",
     function()
-        local limit = 10
         return test:execsql [[
             SELECT x FROM t1 LIMIT 10;
         ]]
diff --git a/test/sql-tap/lua/sqltester.lua b/test/sql-tap/lua/sqltester.lua
index bfd14a1a7..53d3c2514 100644
--- a/test/sql-tap/lua/sqltester.lua
+++ b/test/sql-tap/lua/sqltester.lua
@@ -378,7 +378,6 @@ function test.randstr(Length)
     for Loop = 0, 255 do
         Chars[Loop+1] = string.char(Loop)
     end
-    local String = table.concat(Chars)
     local Result = {}
     local Lookup = Chars
     local Range = #Lookup
diff --git a/test/sql-tap/misc1.test.lua b/test/sql-tap/misc1.test.lua
index 7d928bea0..b1c4f026b 100755
--- a/test/sql-tap/misc1.test.lua
+++ b/test/sql-tap/misc1.test.lua
@@ -726,19 +726,8 @@ test:do_execsql_test(
 -- MUST_WORK_TEST collate
 if 0>0 then
     db("collate", "numeric", "numeric_collate")
-    local function numeric_collate(lhs, rhs)
-        if (lhs == rhs)
-        then
-            return 0
-        end
-        return X(0, "X!expr", [=[["?:",[">",["lhs"],["rhs"]],3,["-",1]]]=])
-    end
-
     -- Mimic the sql 2 collation type TEXT.
     db("collate", "text", "text_collate")
-    local function numeric_collate(lhs, rhs)
-        return X(34, "X!cmd", [=[["string","compare",["lhs"],["rhs"]]]=])
-    end
 
 test:do_execsql_test(
     "misc1-12.11",
diff --git a/test/sql-tap/misc3.test.lua b/test/sql-tap/misc3.test.lua
index f27e83745..d4dac324b 100755
--- a/test/sql-tap/misc3.test.lua
+++ b/test/sql-tap/misc3.test.lua
@@ -1,6 +1,5 @@
 #!/usr/bin/env tarantool
 local test = require("sqltester")
-local json = require("json")
 test:plan(34)
 
 --!./tcltestrunner.lua
diff --git a/test/sql-tap/orderby1.test.lua b/test/sql-tap/orderby1.test.lua
index cc65360c4..f2b0fa06e 100755
--- a/test/sql-tap/orderby1.test.lua
+++ b/test/sql-tap/orderby1.test.lua
@@ -19,7 +19,7 @@ test:plan(35)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "orderby1"
+
 -- MUST_WORK_TEST
 -- # Generate test data for a join.  Verify that the join gets the
 -- # correct answer.
diff --git a/test/sql-tap/orderby2.test.lua b/test/sql-tap/orderby2.test.lua
index 03f5b3cee..3759b77bd 100755
--- a/test/sql-tap/orderby2.test.lua
+++ b/test/sql-tap/orderby2.test.lua
@@ -19,7 +19,7 @@ test:plan(9)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "orderby2"
+
 -- Generate test data for a join.  Verify that the join gets the
 -- correct answer.
 --
diff --git a/test/sql-tap/orderby3.test.lua b/test/sql-tap/orderby3.test.lua
index 6cbccf2e7..cf07bd3e7 100755
--- a/test/sql-tap/orderby3.test.lua
+++ b/test/sql-tap/orderby3.test.lua
@@ -20,7 +20,7 @@ test:plan(15)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "orderby3"
+
 -- Generate test data for a join.  Verify that the join gets the
 -- correct answer.
 --
diff --git a/test/sql-tap/orderby4.test.lua b/test/sql-tap/orderby4.test.lua
index 87f011e0a..9bcb630ef 100755
--- a/test/sql-tap/orderby4.test.lua
+++ b/test/sql-tap/orderby4.test.lua
@@ -21,7 +21,7 @@ test:plan(6)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "orderby4"
+
 -- Generate test data for a join.  Verify that the join gets the
 -- correct answer.
 --
diff --git a/test/sql-tap/orderby5.test.lua b/test/sql-tap/orderby5.test.lua
index 0a1b69cfd..519c0ef5f 100755
--- a/test/sql-tap/orderby5.test.lua
+++ b/test/sql-tap/orderby5.test.lua
@@ -19,7 +19,7 @@ test:plan(10)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "orderby5"
+
 -- Generate test data for a join.  Verify that the join gets the
 -- correct answer.
 --
diff --git a/test/sql-tap/orderby6.test.lua b/test/sql-tap/orderby6.test.lua
index cc8879ae6..8d4a0507b 100755
--- a/test/sql-tap/orderby6.test.lua
+++ b/test/sql-tap/orderby6.test.lua
@@ -26,7 +26,7 @@ test:plan(34)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "orderby6"
+
 -- Run all tests twice.  Once with a normal table and a second time
 -- with a WITHOUT ROWID table
 --
diff --git a/test/sql-tap/orderby8.test.lua b/test/sql-tap/orderby8.test.lua
index dc0101769..e6b9bf7b9 100755
--- a/test/sql-tap/orderby8.test.lua
+++ b/test/sql-tap/orderby8.test.lua
@@ -22,7 +22,6 @@ test:plan(203)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "orderby8"
 
 local rs = ""
 test:do_test(
diff --git a/test/sql-tap/orderby9.test.lua b/test/sql-tap/orderby9.test.lua
index 1fad72ddd..6957ed098 100755
--- a/test/sql-tap/orderby9.test.lua
+++ b/test/sql-tap/orderby9.test.lua
@@ -22,7 +22,6 @@ test:plan(4)
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
 
-local testprefix = "orderby9"
 test:do_execsql_test(
     "setup",
     [[
diff --git a/test/sql-tap/select4.test.lua b/test/sql-tap/select4.test.lua
index abc95a24f..e2b13090d 100755
--- a/test/sql-tap/select4.test.lua
+++ b/test/sql-tap/select4.test.lua
@@ -30,7 +30,7 @@ test:execsql [[
     CREATE TABLE t1(n int primary key, log int);
     START TRANSACTION;
 ]]
-local i, j
+local j
 for i = 1, 31, 1 do
     j = 0
     while math.pow(2, j) < i do
diff --git a/test/sql-tap/select5.test.lua b/test/sql-tap/select5.test.lua
index d531cbcf8..2902def37 100755
--- a/test/sql-tap/select5.test.lua
+++ b/test/sql-tap/select5.test.lua
@@ -27,7 +27,7 @@ test:execsql [[
     CREATE TABLE t1(x int primary key, y int);
     START TRANSACTION;
 ]]
-local i, j
+local j
 for i = 1, 31, 1 do
     j = 0
     while math.pow(2, j) < i do
diff --git a/test/sql-tap/select6.test.lua b/test/sql-tap/select6.test.lua
index 47c2ff5ef..82505f034 100755
--- a/test/sql-tap/select6.test.lua
+++ b/test/sql-tap/select6.test.lua
@@ -22,8 +22,6 @@ test:plan(88)
 -- ["source",[["testdir"],"\/tester.tcl"]]
 -- Omit this whole file if the library is build without subquery support.
 
-
-local testprefix = "select6"
 test:do_test(
     "select6-1.0",
     function()
@@ -665,7 +663,7 @@ local json = require("json")
 local function is_flat(sql)
     local r = test:execsql("EXPLAIN "..sql)
     r = json.encode(r)
-    local i, j = string.find(r,"OpenEphemeral")
+    local i = string.find(r,"OpenEphemeral")
     -- return 1 if there is no OpenEphemeral in r
     return i == nil and {1} or {0}
 end
diff --git a/test/sql-tap/select7.test.lua b/test/sql-tap/select7.test.lua
index 67edc5db3..7ff1f76d5 100755
--- a/test/sql-tap/select7.test.lua
+++ b/test/sql-tap/select7.test.lua
@@ -18,7 +18,6 @@ test:plan(18)
 -- $Id: select7.test,v 1.11 2007/09/12 17:01:45 danielk1977 Exp $
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "select7"
 -- A 3-way INTERSECT.  Ticket #875
 test:do_execsql_test(
     "select7-1.1",
diff --git a/test/sql-tap/select9.test.lua b/test/sql-tap/select9.test.lua
index 4f7da84e2..045d0e4c8 100755
--- a/test/sql-tap/select9.test.lua
+++ b/test/sql-tap/select9.test.lua
@@ -274,10 +274,8 @@ test:do_execsql_test(
         -- </select9-2.0>
     })
 
-local t1_space_id = ""
-local t2_space_id = ""
-t1_space_id = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"]
-t2_space_id = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"]
+local _ = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"]
+local _ = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"]
 --X(276, "X!cmd", [=[["db","eval","SELECT * from _space where name='t2'","data","\n  set t2_space_id $data(id)\n"]]=])
 --local function reverse(lhs, rhs)
 --    return X(283, "X!cmd", [=[["string","compare",["rhs"],["lhs"]]]=])
@@ -289,7 +287,6 @@ t2_space_id = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"]
 -- to them. Sometimes the WHERE clause may be satisfied using the same
 -- index used for ORDER BY, sometimes not.
 --
-local recreate_i1 = "DROP INDEX i1 ON t1; CREATE INDEX i1 ON t1(b, a)"
 iOuterLoop = 1
 for _, indexes in ipairs({ [[
   /* Do not create any indexes. */
@@ -480,7 +477,6 @@ test:do_execsql_test(
 --
 -- For additional information.
 --
-local json = require('json')
 test:do_test(
     "select9-5.1",
     function()
diff --git a/test/sql-tap/selectA.test.lua b/test/sql-tap/selectA.test.lua
index a608ab093..db4d03985 100755
--- a/test/sql-tap/selectA.test.lua
+++ b/test/sql-tap/selectA.test.lua
@@ -25,8 +25,6 @@ test:plan(194)
 -- $Id: selectA.test,v 1.6 2008/08/21 14:24:29 drh Exp $
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "selectA"
-
 
 test:do_execsql_test(
     "selectA-1.0",
@@ -2359,9 +2357,6 @@ test:do_execsql_test(
 if (0 > 0)
  then
 end
-local function f(args)
-    return 1
-end
 
 -- TODO stored procedures are not supported by now
 --db("func", "f", "f")
diff --git a/test/sql-tap/selectF.test.lua b/test/sql-tap/selectF.test.lua
index dbd9dfdad..2a86a4da8 100755
--- a/test/sql-tap/selectF.test.lua
+++ b/test/sql-tap/selectF.test.lua
@@ -20,7 +20,6 @@ test:plan(2)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "selectF"
 test:do_execsql_test(
     1,
     [[
diff --git a/test/sql-tap/selectG.test.lua b/test/sql-tap/selectG.test.lua
index a9c7d9fb6..d416381bd 100755
--- a/test/sql-tap/selectG.test.lua
+++ b/test/sql-tap/selectG.test.lua
@@ -19,7 +19,6 @@ test:plan(1)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "selectG"
 -- Do an INSERT with a VALUES clause that contains 100,000 entries.  Verify
 -- that this insert happens quickly (in less than 10 seconds).  Actually, the
 -- insert will normally happen in less than 0.5 seconds on a workstation, but
@@ -36,7 +35,6 @@ test:do_test(
     function()
         local sql_arr = {[[CREATE TABLE t1(x INT primary key);
             INSERT INTO t1(x) VALUES]]}
-        local i
         for i = 1, 100000-1, 1 do
             table.insert(sql_arr, "("..i.."),")
         end
diff --git a/test/sql-tap/sort.test.lua b/test/sql-tap/sort.test.lua
index 5a951b0e9..a11522741 100755
--- a/test/sql-tap/sort.test.lua
+++ b/test/sql-tap/sort.test.lua
@@ -19,7 +19,6 @@ test:plan(60)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "sort"
 -- Create a bunch of data to sort against
 --
 test:do_test(
@@ -794,7 +793,6 @@ box.internal.sql_create_function("cksum", cksum)
             "sort-14."..tn,
             function()
                 sql_test_control("sql_TESTCTRL_SORTER_MMAP", "db", mmap_limit)
-                local prev = ""
                 X(536, "X!cmd", [=[["db","eval"," SELECT * FROM t11 ORDER BY b ","\n         if {$b != [cksum $a]} {error \"checksum failed\"}\n         if {[string compare $b $prev] < 0} {error \"sort failed\"}\n         set prev $b\n       "]]=])
                 return X(541, "X!cmd", [=[["set","",""]]=])
             end, {
diff --git a/test/sql-tap/subquery2.test.lua b/test/sql-tap/subquery2.test.lua
index 5cd1afa86..92fe33d04 100755
--- a/test/sql-tap/subquery2.test.lua
+++ b/test/sql-tap/subquery2.test.lua
@@ -19,8 +19,6 @@ test:plan(11)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "subquery2"
-
 
 test:do_test(
     "subquery2-1.1",
diff --git a/test/sql-tap/tkt-385a5b56b9.test.lua b/test/sql-tap/tkt-385a5b56b9.test.lua
index d10c3152e..fe314e802 100755
--- a/test/sql-tap/tkt-385a5b56b9.test.lua
+++ b/test/sql-tap/tkt-385a5b56b9.test.lua
@@ -17,7 +17,6 @@ test:plan(9)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "tkt-385a5b56b9"
 test:do_execsql_test(
     "1.0",
     [[
diff --git a/test/sql-tap/tkt-38cb5df375.test.lua b/test/sql-tap/tkt-38cb5df375.test.lua
index 1539005b8..b373bbc57 100755
--- a/test/sql-tap/tkt-38cb5df375.test.lua
+++ b/test/sql-tap/tkt-38cb5df375.test.lua
@@ -31,7 +31,6 @@ local function lrange(arr, start_num, end_num)
     return tmp
 end
 
-local ii
 test:do_execsql_test(
     "tkt-38cb5df375.0",
     [[
diff --git a/test/sql-tap/tkt-3a77c9714e.test.lua b/test/sql-tap/tkt-3a77c9714e.test.lua
index 82225ce89..b529d32bc 100755
--- a/test/sql-tap/tkt-3a77c9714e.test.lua
+++ b/test/sql-tap/tkt-3a77c9714e.test.lua
@@ -20,8 +20,6 @@ test:plan(4)
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
 
-
-local testprefix = "tkt-3a77c9714e"
 test:do_execsql_test(
     1.1,
     [[
diff --git a/test/sql-tap/tkt-4dd95f6943.test.lua b/test/sql-tap/tkt-4dd95f6943.test.lua
index c1d862a9d..5f6077d2a 100755
--- a/test/sql-tap/tkt-4dd95f6943.test.lua
+++ b/test/sql-tap/tkt-4dd95f6943.test.lua
@@ -17,7 +17,6 @@ test:plan(319)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "tkt-4dd95f6943"
 test:do_execsql_test(
     1.0,
     [[
diff --git a/test/sql-tap/tkt-4ef7e3cfca.test.lua b/test/sql-tap/tkt-4ef7e3cfca.test.lua
index 9b02d42b7..a97079e74 100755
--- a/test/sql-tap/tkt-4ef7e3cfca.test.lua
+++ b/test/sql-tap/tkt-4ef7e3cfca.test.lua
@@ -19,7 +19,6 @@ test:plan(5)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "tkt-4ef7e3cfca"
 
 test:do_catchsql_test(
     1.1,
diff --git a/test/sql-tap/tkt-54844eea3f.test.lua b/test/sql-tap/tkt-54844eea3f.test.lua
index 042436c61..bfb94507c 100755
--- a/test/sql-tap/tkt-54844eea3f.test.lua
+++ b/test/sql-tap/tkt-54844eea3f.test.lua
@@ -18,7 +18,6 @@ test:plan(3)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "tkt-54844eea3f"
 test:do_execsql_test(
     "1.0",
     [[
diff --git a/test/sql-tap/tkt-7bbfb7d442.test.lua b/test/sql-tap/tkt-7bbfb7d442.test.lua
index 43537d229..1a748217d 100755
--- a/test/sql-tap/tkt-7bbfb7d442.test.lua
+++ b/test/sql-tap/tkt-7bbfb7d442.test.lua
@@ -20,7 +20,6 @@ test:plan(5)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "tkt-7bbfb7d442"
 -- MUST_WORK_TEST
 if (1 > 0)
  then
diff --git a/test/sql-tap/tkt-80ba201079.test.lua b/test/sql-tap/tkt-80ba201079.test.lua
index 296bfe074..7b961aacd 100755
--- a/test/sql-tap/tkt-80ba201079.test.lua
+++ b/test/sql-tap/tkt-80ba201079.test.lua
@@ -22,7 +22,6 @@ test:plan(11)
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
 
-local testprefix = "tkt-80ba201079"
 test:do_test(
     "tkt-80ba2-100",
     function()
diff --git a/test/sql-tap/tkt-8c63ff0ec.test.lua b/test/sql-tap/tkt-8c63ff0ec.test.lua
index 776407ac2..3473b9105 100755
--- a/test/sql-tap/tkt-8c63ff0ec.test.lua
+++ b/test/sql-tap/tkt-8c63ff0ec.test.lua
@@ -20,7 +20,6 @@ test:plan(3)
 -- 
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "tkt-8c63ff0ec"
 test:do_execsql_test(
     1.1,
     [[
diff --git a/test/sql-tap/tkt-91e2e8ba6f.test.lua b/test/sql-tap/tkt-91e2e8ba6f.test.lua
index c6d9a26d8..a72b8d957 100755
--- a/test/sql-tap/tkt-91e2e8ba6f.test.lua
+++ b/test/sql-tap/tkt-91e2e8ba6f.test.lua
@@ -17,7 +17,6 @@ test:plan(7)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "tkt-91e2e8ba6f"
 test:do_execsql_test(
     1.1,
     [[
diff --git a/test/sql-tap/tkt-9a8b09f8e6.test.lua b/test/sql-tap/tkt-9a8b09f8e6.test.lua
index 8f305e444..3fbc1ce37 100755
--- a/test/sql-tap/tkt-9a8b09f8e6.test.lua
+++ b/test/sql-tap/tkt-9a8b09f8e6.test.lua
@@ -20,7 +20,6 @@ test:plan(47)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "tkt-9a8b09f8e6"
 -- MUST_WORK_TEST
 if (0 > 0)
  then
diff --git a/test/sql-tap/tkt-a8a0d2996a.test.lua b/test/sql-tap/tkt-a8a0d2996a.test.lua
index 3b824106b..4878f8436 100755
--- a/test/sql-tap/tkt-a8a0d2996a.test.lua
+++ b/test/sql-tap/tkt-a8a0d2996a.test.lua
@@ -19,7 +19,6 @@ test:plan(12)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "tkt-a8a0d2996a"
 test:do_execsql_test(
     1.0,
     [[
diff --git a/test/sql-tap/tkt-b1d3a2e531.test.lua b/test/sql-tap/tkt-b1d3a2e531.test.lua
index f10f14a24..d1d47d705 100755
--- a/test/sql-tap/tkt-b1d3a2e531.test.lua
+++ b/test/sql-tap/tkt-b1d3a2e531.test.lua
@@ -21,9 +21,6 @@ test:plan(11)
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
 
-
-local testprefix = "tkt-b1d3a2e531"
-
 test:do_execsql_test(
     1.1,
     [[
diff --git a/test/sql-tap/tkt-b75a9ca6b0.test.lua b/test/sql-tap/tkt-b75a9ca6b0.test.lua
index cc0374357..1bce3805d 100755
--- a/test/sql-tap/tkt-b75a9ca6b0.test.lua
+++ b/test/sql-tap/tkt-b75a9ca6b0.test.lua
@@ -23,7 +23,6 @@ test:plan(20)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "tkt-b75a9ca6b0"
 test:do_execsql_test(
     1,
     [[
diff --git a/test/sql-tap/tkt-ba7cbfaedc.test.lua b/test/sql-tap/tkt-ba7cbfaedc.test.lua
index b214e9f0e..7ceda9270 100755
--- a/test/sql-tap/tkt-ba7cbfaedc.test.lua
+++ b/test/sql-tap/tkt-ba7cbfaedc.test.lua
@@ -18,7 +18,6 @@ test:plan(19)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "tkt-ba7cbfaedc"
 test:do_execsql_test(
     1,
     [[
diff --git a/test/sql-tap/tkt-bd484a090c.test.lua b/test/sql-tap/tkt-bd484a090c.test.lua
index 50c76304c..6187fee7f 100755
--- a/test/sql-tap/tkt-bd484a090c.test.lua
+++ b/test/sql-tap/tkt-bd484a090c.test.lua
@@ -18,7 +18,6 @@ test:plan(0)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "tkt-bd484a090c"
 
 -- Disabled until #3694 is resolved.
 --
diff --git a/test/sql-tap/tkt-d635236375.test.lua b/test/sql-tap/tkt-d635236375.test.lua
index 1b3e94f82..52f16c20e 100755
--- a/test/sql-tap/tkt-d635236375.test.lua
+++ b/test/sql-tap/tkt-d635236375.test.lua
@@ -19,7 +19,6 @@ test:plan(2)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "tkt-d635236375"
 test:do_execsql_test(
     1.0,
     [[
diff --git a/test/sql-tap/trigger1.test.lua b/test/sql-tap/trigger1.test.lua
index 8224ef1ec..0efdd21bc 100755
--- a/test/sql-tap/trigger1.test.lua
+++ b/test/sql-tap/trigger1.test.lua
@@ -482,8 +482,6 @@ test:execsql [[
 -- trigger works.  Then drop the trigger.  Make sure the table is
 -- still there.
 --
-local view_v1 = "view v1"
-
 
 -- do_test trigger1-6.1 {
 --   execsql {SELECT type, name FROM sql_master}
diff --git a/test/sql-tap/trigger9.test.lua b/test/sql-tap/trigger9.test.lua
index b8e1fc876..89b5b89ef 100755
--- a/test/sql-tap/trigger9.test.lua
+++ b/test/sql-tap/trigger9.test.lua
@@ -34,8 +34,6 @@ test:plan(28)
 -- ["source",[["testdir"],"\/tester.tcl"]]
 
 
-local testprefix = "trigger9"
-
 local function has_rowdata(sql)
     local result = test:execsql('EXPLAIN '..sql)
 
diff --git a/test/sql-tap/triggerA.test.lua b/test/sql-tap/triggerA.test.lua
index 38a3dbea2..6a801bda2 100755
--- a/test/sql-tap/triggerA.test.lua
+++ b/test/sql-tap/triggerA.test.lua
@@ -36,7 +36,6 @@ test:do_test(
             CREATE TABLE t1(x INTEGER PRIMARY KEY, y TEXT UNIQUE);
             CREATE TABLE t2(a INTEGER PRIMARY KEY, b INTEGER UNIQUE, c TEXT);
         ]]
-        local i = 1
         local words = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"}
         for i, word in ipairs(words) do
         -- for _ in X(0, "X!foreach", [=[["word","one two three four five six seven eight nine ten"]]=]) do
diff --git a/test/sql-tap/triggerC.test.lua b/test/sql-tap/triggerC.test.lua
index 7d496bc4d..273d21d39 100755
--- a/test/sql-tap/triggerC.test.lua
+++ b/test/sql-tap/triggerC.test.lua
@@ -16,7 +16,6 @@ test:plan(43)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "triggerC"
 
 
 ---------------------------------------------------------------------------
diff --git a/test/sql-tap/types.test.lua b/test/sql-tap/types.test.lua
index 91a89b887..dad88bdef 100755
--- a/test/sql-tap/types.test.lua
+++ b/test/sql-tap/types.test.lua
@@ -1,6 +1,5 @@
 #!/usr/bin/env tarantool
 local test = require("sqltester")
-local NULL = require('msgpack').NULL
 test:plan(14)
 
 --!./tcltestrunner.lua
diff --git a/test/sql-tap/where2.test.lua b/test/sql-tap/where2.test.lua
index 3b7e36093..19611a05f 100755
--- a/test/sql-tap/where2.test.lua
+++ b/test/sql-tap/where2.test.lua
@@ -1,8 +1,5 @@
 #!/usr/bin/env tarantool
 local test = require("sqltester")
-local yaml = require("yaml")
-local fio = require("fio")
-
 local ffi = require("ffi")
 test:plan(74)
 
@@ -60,16 +57,6 @@ test:do_test(
         -- </where2-1.0>
     })
 
--- Do an SQL statement.  Append the search count to the end of the result.
---
-local function count(sql)
-    local sql_sort_count = box.stat.sql().sql_sort_count
-    local r = test:execsql(sql)
-    print("lol "..(box.stat.sql().sql_sort_count - sql_sort_count))
-    table.insert(r, box.stat.sql().sql_sort_count - sql_sort_count)
-    return r
-end
-
 -- This procedure executes the SQL.  Then it checks to see if the OP_Sort
 -- opcode was executed.  If an OP_Sort did occur, then "sort" is appended
 -- to the result.  If no OP_Sort happened, then "nosort" is appended.
diff --git a/test/sql-tap/where4.test.lua b/test/sql-tap/where4.test.lua
index 65e7f9337..8eae3dc2c 100755
--- a/test/sql-tap/where4.test.lua
+++ b/test/sql-tap/where4.test.lua
@@ -23,8 +23,6 @@ test:plan(8)
 -- $Id: where4.test,v 1.6 2007/12/10 05:03:48 danielk1977 Exp $
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "where4"
-
 
 -- Build some test data
 --
diff --git a/test/sql-tap/whereC.test.lua b/test/sql-tap/whereC.test.lua
index 334d4cf29..145febd90 100755
--- a/test/sql-tap/whereC.test.lua
+++ b/test/sql-tap/whereC.test.lua
@@ -1,6 +1,5 @@
 #!/usr/bin/env tarantool
 local test = require("sqltester")
-local yaml = require('yaml')
 test:plan(41)
 
 --!./tcltestrunner.lua
@@ -17,7 +16,6 @@ test:plan(41)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "whereC"
 test:do_execsql_test(
     1.0,
     [[
diff --git a/test/sql-tap/whereD.test.lua b/test/sql-tap/whereD.test.lua
index 26221ec12..e0e9a3853 100755
--- a/test/sql-tap/whereD.test.lua
+++ b/test/sql-tap/whereD.test.lua
@@ -19,7 +19,6 @@ test:plan(36)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "whereD"
 test:do_execsql_test(
     1.1,
     [[
diff --git a/test/sql-tap/whereF.test.lua b/test/sql-tap/whereF.test.lua
index 12aefc4a4..73c87abc9 100755
--- a/test/sql-tap/whereF.test.lua
+++ b/test/sql-tap/whereF.test.lua
@@ -48,7 +48,6 @@ test:plan(13)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "whereF"
 test:do_execsql_test(
     1.0,
     [[
diff --git a/test/sql-tap/whereG.test.lua b/test/sql-tap/whereG.test.lua
index 2fbc6c5b3..2a76d2438 100755
--- a/test/sql-tap/whereG.test.lua
+++ b/test/sql-tap/whereG.test.lua
@@ -18,7 +18,6 @@ test:plan(23)
 -- likelihood() functions.
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "whereG"
 test:do_execsql_test(
     "whereG-1.0",
     [[
diff --git a/test/sql-tap/whereI.test.lua b/test/sql-tap/whereI.test.lua
index 79c6bcfe5..43614b0eb 100755
--- a/test/sql-tap/whereI.test.lua
+++ b/test/sql-tap/whereI.test.lua
@@ -20,7 +20,6 @@ test:plan(7)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "whereI"
 test:do_execsql_test(1.0, [[
     CREATE TABLE t1(a INT, b TEXT, c TEXT, PRIMARY KEY(a));
     INSERT INTO t1 VALUES(1, 'a', 'z');
diff --git a/test/sql-tap/whereK.test.lua b/test/sql-tap/whereK.test.lua
index 0ca7fff0d..597a6f414 100755
--- a/test/sql-tap/whereK.test.lua
+++ b/test/sql-tap/whereK.test.lua
@@ -23,7 +23,6 @@ test:plan(10)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "whereK"
 test:do_execsql_test(1.1, [[
   CREATE TABLE t1(a INT ,b INT ,c INT , primary key (a,b,c));
   WITH RECURSIVE c(x) AS (VALUES(0) UNION ALL SELECT x+1 FROM c WHERE x<99)
diff --git a/test/sql-tap/with1.test.lua b/test/sql-tap/with1.test.lua
index 86dd4f83a..89a427ecc 100755
--- a/test/sql-tap/with1.test.lua
+++ b/test/sql-tap/with1.test.lua
@@ -18,7 +18,6 @@ test:plan(64)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "with1"
 -- if X(0, "X!capable", [["!cte"]]) then
 --   test:finish_test()
 --  return 
diff --git a/test/sql-tap/with2.test.lua b/test/sql-tap/with2.test.lua
index 456ded363..c16efac4d 100755
--- a/test/sql-tap/with2.test.lua
+++ b/test/sql-tap/with2.test.lua
@@ -18,7 +18,6 @@ test:plan(59)
 --
 -- ["set","testdir",[["file","dirname",["argv0"]]]]
 -- ["source",[["testdir"],"\/tester.tcl"]]
-local testprefix = "with2"
 
 test:do_execsql_test(
     1.0,
-- 
2.25.1



More information about the Tarantool-patches mailing list