[Tarantool-patches] [PATCH v1 2/2] Restore date/datetime tests
Timur Safin
tsafin at tarantool.org
Thu Apr 30 11:26:54 MSK 2020
Commit #3caeb33cdaf4b37974fd5f12e08310502d9e73f3 has disabled
all datetime tests. Now, having restored datetime functions support
we revert it, and restore sql testing for those functions
Closes #4898
---
test/sql-tap/date.test.lua | 4 ----
test/sql-tap/keyword1.test.lua | 5 +----
test/sql-tap/table.test.lua | 6 +-----
test/sql-tap/tkt-7bbfb7d442.test.lua | 4 ++--
test/sql-tap/tkt-bd484a090c.test.lua | 6 ++----
test/sql-tap/tkt2192.test.lua | 6 +-----
test/sql-tap/tkt3791.test.lua | 5 +----
test/sql/triggers.result | 4 ++--
test/sql/triggers.test.lua | 4 ++--
9 files changed, 12 insertions(+), 32 deletions(-)
diff --git a/test/sql-tap/date.test.lua b/test/sql-tap/date.test.lua
index 87fc80db0..5a028b483 100755
--- a/test/sql-tap/date.test.lua
+++ b/test/sql-tap/date.test.lua
@@ -27,9 +27,6 @@ test:plan(0)
-- at compile-time
--
--- Disabled until #3694 is resolved.
---
-if false then
local function datetest(tnum, expr, result)
test:do_test(
"date-"..tnum,
@@ -481,7 +478,6 @@ test:do_test(
1
-- </date-15.2>
})
-end -- if false
test:finish_test()
diff --git a/test/sql-tap/keyword1.test.lua b/test/sql-tap/keyword1.test.lua
index e39b22087..736a0ce24 100755
--- a/test/sql-tap/keyword1.test.lua
+++ b/test/sql-tap/keyword1.test.lua
@@ -1,6 +1,6 @@
#!/usr/bin/env tarantool
test = require("sqltester")
-test:plan(184)
+test:plan(181)
--!./tcltestrunner.lua
-- 2009 January 29
@@ -67,9 +67,6 @@ local bannedkws = {
"constraint",
"create",
"cross",
- "current_date",
- "current_time",
- "current_timestamp",
"default",
"delete",
"desc",
diff --git a/test/sql-tap/table.test.lua b/test/sql-tap/table.test.lua
index 1b4ec1173..e81c95d36 100755
--- a/test/sql-tap/table.test.lua
+++ b/test/sql-tap/table.test.lua
@@ -1,6 +1,6 @@
#!/usr/bin/env tarantool
test = require("sqltester")
-test:plan(79)
+test:plan(80)
--!./tcltestrunner.lua
-- 2001 September 15
@@ -945,9 +945,6 @@ test:do_execsql_test(
-- Test the ability to have default values of CURRENT_TIME, CURRENT_DATE
-- and CURRENT_TIMESTAMP.
--
--- Disabled until #3694 is resolved.
---
-if false then
test:do_execsql_test(
"table-13.1",
[[
@@ -963,7 +960,6 @@ test:do_execsql_test(
-- </table-13.1>
})
-end
----------------------------------------------------------------------
-- Test cases table-14.*
diff --git a/test/sql-tap/tkt-7bbfb7d442.test.lua b/test/sql-tap/tkt-7bbfb7d442.test.lua
index 535303771..9ec35edf1 100755
--- a/test/sql-tap/tkt-7bbfb7d442.test.lua
+++ b/test/sql-tap/tkt-7bbfb7d442.test.lua
@@ -92,7 +92,7 @@ if (1 > 0)
InventoryControlId INTEGER,
SKU INTEGER NOT NULL PRIMARY KEY,
Variant INTEGER NOT NULL DEFAULT 0,
- ControlDate TEXT NOT NULL,
+ ControlDate DATE NOT NULL,
ControlState INTEGER NOT NULL DEFAULT -1,
DeliveredQty TEXT
);
@@ -162,7 +162,7 @@ if (1 > 0)
INSERT INTO InventoryControl(SKU, Variant, ControlDate) SELECT
- II.SKU AS SKU, II.Variant AS Variant, '2011-08-30' AS ControlDate
+ II.SKU AS SKU, II.Variant AS Variant, julianday('2011-08-30') AS ControlDate
FROM InventoryItem II;
]])
diff --git a/test/sql-tap/tkt-bd484a090c.test.lua b/test/sql-tap/tkt-bd484a090c.test.lua
index 0347fd426..a8de32591 100755
--- a/test/sql-tap/tkt-bd484a090c.test.lua
+++ b/test/sql-tap/tkt-bd484a090c.test.lua
@@ -20,9 +20,6 @@ test:plan(0)
-- ["source",[["testdir"],"\/tester.tcl"]]
testprefix = "tkt-bd484a090c"
--- Disabled until #3694 is resolved.
---
-if false then
test:do_test(
1.1,
function()
@@ -34,7 +31,8 @@ test:do_test(
function()
return test:catchsql(" SELECT datetime('now', 'utc') ")[1]
end, 0)
-end -- if false
+
+-- FIXME - uncomment?
-- TBI to be implemented feature
--sql_test_control("sql_TESTCTRL_LOCALTIME_FAULT", 1)
--test:do_catchsql_test(
diff --git a/test/sql-tap/tkt2192.test.lua b/test/sql-tap/tkt2192.test.lua
index 52309ff2b..1d96ba18f 100755
--- a/test/sql-tap/tkt2192.test.lua
+++ b/test/sql-tap/tkt2192.test.lua
@@ -1,7 +1,7 @@
#!/usr/bin/env tarantool
test = require("sqltester")
-- test:plan(6)
-test:plan(4)
+test:plan(6)
--!./tcltestrunner.lua
-- 2007 January 26
@@ -24,9 +24,6 @@ test:plan(4)
-- ["set","testdir",[["file","dirname",["argv0"]]]]
-- ["source",[["testdir"],"\/tester.tcl"]]
--- Disabled until #3694 is resolved.
---
-if false then
test:do_execsql_test(
"tkt2192-1.1",
[[
@@ -108,7 +105,6 @@ test:do_test(
-- </tkt2192-1.2>
})
-end -- if false
test:do_execsql_test(
"tkt2192-2.1",
diff --git a/test/sql-tap/tkt3791.test.lua b/test/sql-tap/tkt3791.test.lua
index d39b6a2d5..0ab66dcbe 100755
--- a/test/sql-tap/tkt3791.test.lua
+++ b/test/sql-tap/tkt3791.test.lua
@@ -22,9 +22,7 @@ test:plan(0)
-- ["set","testdir",[["file","dirname",["argv0"]]]]
-- ["source",[["testdir"],"\/tester.tcl"]]
-- MUST_WORK_TEST
--- Disabled until #3694 is resolved.
---
-if (0 > 0) then
+
test:do_test(
"tkt3791-1.1",
function()
@@ -38,7 +36,6 @@ test:do_test(
1, 19
-- </tkt3791-1.1>
})
-end
test:finish_test()
diff --git a/test/sql/triggers.result b/test/sql/triggers.result
index ceecb8ef2..50edb26ad 100644
--- a/test/sql/triggers.result
+++ b/test/sql/triggers.result
@@ -299,7 +299,7 @@ box.execute("CREATE TABLE m (s0 INT PRIMARY KEY, s1 TEXT UNIQUE);")
---
- row_count: 1
...
-box.execute("CREATE TRIGGER m1 BEFORE UPDATE ON m FOR EACH ROW BEGIN UPDATE n SET s2 = 'now'; END;")
+box.execute("CREATE TRIGGER m1 BEFORE UPDATE ON m FOR EACH ROW BEGIN UPDATE n SET s2 = DATETIME('now'); END;")
---
- row_count: 1
...
@@ -343,7 +343,7 @@ box.execute("CREATE TABLE m (s0 INT PRIMARY KEY, s1 TEXT UNIQUE);")
---
- row_count: 1
...
-box.execute("CREATE TRIGGER m1 BEFORE UPDATE ON m FOR EACH ROW BEGIN UPDATE n SET s2 = 'now'; END;")
+box.execute("CREATE TRIGGER m1 BEFORE UPDATE ON m FOR EACH ROW BEGIN UPDATE n SET s2 = DATETIME('now'); END;")
---
- row_count: 1
...
diff --git a/test/sql/triggers.test.lua b/test/sql/triggers.test.lua
index f5c8a3961..9c26f7a18 100644
--- a/test/sql/triggers.test.lua
+++ b/test/sql/triggers.test.lua
@@ -102,7 +102,7 @@ box.execute("DROP TABLE T1;")
-- Case 1: Src 'vinyl' table; Dst 'memtx' table
box.space._session_settings:update('sql_default_engine', {{'=', 2, 'vinyl'}})
box.execute("CREATE TABLE m (s0 INT PRIMARY KEY, s1 TEXT UNIQUE);")
-box.execute("CREATE TRIGGER m1 BEFORE UPDATE ON m FOR EACH ROW BEGIN UPDATE n SET s2 = 'now'; END;")
+box.execute("CREATE TRIGGER m1 BEFORE UPDATE ON m FOR EACH ROW BEGIN UPDATE n SET s2 = DATETIME('now'); END;")
box.space._session_settings:update('sql_default_engine', {{'=', 2, 'memtx'}})
box.execute("CREATE TABLE n (s0 INT PRIMARY KEY, s1 TEXT UNIQUE, s2 NUMBER);")
box.execute("INSERT INTO m VALUES (0, '0');")
@@ -118,7 +118,7 @@ box.execute("DROP TABLE n;")
-- Case 2: Src 'memtx' table; Dst 'vinyl' table
box.space._session_settings:update('sql_default_engine', {{'=', 2, 'memtx'}})
box.execute("CREATE TABLE m (s0 INT PRIMARY KEY, s1 TEXT UNIQUE);")
-box.execute("CREATE TRIGGER m1 BEFORE UPDATE ON m FOR EACH ROW BEGIN UPDATE n SET s2 = 'now'; END;")
+box.execute("CREATE TRIGGER m1 BEFORE UPDATE ON m FOR EACH ROW BEGIN UPDATE n SET s2 = DATETIME('now'); END;")
box.space._session_settings:update('sql_default_engine', {{'=', 2, 'vinyl'}})
box.execute("CREATE TABLE n (s0 INT PRIMARY KEY, s1 TEXT UNIQUE, s2 NUMBER);")
box.execute("INSERT INTO m VALUES (0, '0');")
--
2.20.1
More information about the Tarantool-patches
mailing list