Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH] sql: remove tests on stmts with 'db table'
@ 2019-02-07 18:17 Ivan Koptelov
  2019-02-07 18:52 ` [tarantool-patches] " n.pettik
  0 siblings, 1 reply; 3+ messages in thread
From: Ivan Koptelov @ 2019-02-07 18:17 UTC (permalink / raw)
  To: tarantool-patches, korablev; +Cc: Ivan Koptelov

We don't have such functionality, but some legacy tests were
existed (disabled).

---
Branch https://github.com/tarantool/tarantool/tree/sudobobo/gh-2172-rm-order-by-and-limit-from-delete

 test/sql-tap/e_delete.test.lua | 206 ---------------------------------
 1 file changed, 206 deletions(-)

diff --git a/test/sql-tap/e_delete.test.lua b/test/sql-tap/e_delete.test.lua
index 0a81eb3bd..a58dc87c7 100755
--- a/test/sql-tap/e_delete.test.lua
+++ b/test/sql-tap/e_delete.test.lua
@@ -100,211 +100,5 @@ test:do_delete_tests("e_delete-1.2", {
     {9, "DELETE FROM t5 WHERE (SELECT max(x) FROM t6)  ;SELECT x FROM t5", {}},
     {10, "DELETE FROM t6 WHERE y>'seven' ; SELECT y FROM t6", {"one", "four", "five"}},
 })
--- #-------------------------------------------------------------------------
--- # Tests for restrictions on DELETE statements that appear within trigger
--- # programs.
--- #
--- forcedelete test.db2
--- forcedelete test.db3
-
--- MUST_WORK_TEST should be rewritten without spaces or deleted
-if (0 > 0) then
-    test:drop_all_tables()
-    test:do_execsql_test("e_delete-2.0",
---   ATTACH 'test.db2' AS aux;
---   ATTACH 'test.db3' AS aux2;
-    [[
-       CREATE TABLE temp.t7(a INT primary key, b INT);   INSERT INTO temp.t7 VALUES(1, 2);
-       CREATE TABLE main.t7(a INT primary key, b INT);   INSERT INTO main.t7 VALUES(3, 4);
-       CREATE TABLE aux.t7(a INT primary key, b INT);    INSERT INTO aux.t7 VALUES(5, 6);
-       CREATE TABLE aux2.t7(a INT primary key, b INT);   INSERT INTO aux2.t7 VALUES(7, 8);
-       CREATE TABLE main.t8(a INT primary key, b INT);   INSERT INTO main.t8 VALUES(1, 2);
-       CREATE TABLE aux.t8(a INT primary key, b INT);    INSERT INTO aux.t8 VALUES(3, 4);
-       CREATE TABLE aux2.t8(a INT primary key, b INT);   INSERT INTO aux2.t8 VALUES(5, 6);
-       CREATE TABLE aux.t9(a INT primary key, b INT);    INSERT INTO aux.t9 VALUES(1, 2);
-       CREATE TABLE aux2.t9(a INT primary key, b INT);   INSERT INTO aux2.t9 VALUES(3, 4);
-       CREATE TABLE aux2.t10(a INT primary key, b INT);  INSERT INTO aux2.t10 VALUES(1, 2);]]
-    , {})
-
-    -- EVIDENCE-OF: R-09681-58560 The table-name specified as part of a
-    -- DELETE statement within a trigger body must be unqualified.
-    --
-    -- EVIDENCE-OF: R-12275-20298 In other words, the schema-name. prefix on
-    -- the table name is not allowed within triggers.
-    --
-
-    test:do_catchsql_test("e_delete-2.1.1",[[
-         CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
-           DELETE FROM main.t2;
-         END;]],
-        {1, "qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers"})
-    test:do_catchsql_test("e_delete-2.1.2",[[
-         CREATE TRIGGER tr1 BEFORE UPDATE ON t2 BEGIN
-           DELETE FROM temp.t7 WHERE a=new.a;
-         END;]],
-        {1, "qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers"})
-    test:do_catchsql_test("e_delete-2.1.3",[[
-         CREATE TRIGGER tr1 AFTER UPDATE ON t8 BEGIN
-           DELETE FROM aux2.t8 WHERE b!=a;
-         END;]],
-        {1, "qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers"})
-    -- EVIDENCE-OF: R-28818-63526 If the table to which the trigger is
-    -- attached is not in the temp database, then DELETE statements within
-    -- the trigger body must operate on tables within the same database as
-    -- it.
-    -- 
-    --   This is tested in two parts. First, check that if a table of the
-    --   specified name does not exist, an error is raised. Secondly, test
-    --   that if tables with the specified name exist in multiple databases,
-    --   the local database table is used.
-    --
-    test:do_delete_tests("e_delete-2.2.1", "-error", " no such table: %s ", {
-     {1, [[
-         CREATE TRIGGER tr1 AFTER INSERT ON t7 BEGIN
-           DELETE FROM t9;
-         END;
-         INSERT INTO main.t7 VALUES(1, 2);]], {"main.t9"}},
-
-     {2, [[
-         CREATE TRIGGER aux.tr2 BEFORE UPDATE ON t9 BEGIN
-           DELETE FROM t10;
-         END;
-         UPDATE t9 SET a=1;]], {"aux.t10"}},
-   })
-    test:do_execsql_test(
-        "e_delete-2.2.X",
-        [[
-            DROP TRIGGER main.tr1;
-            DROP TRIGGER aux.tr2;
-        ]], {
-            -- <e_delete-2.2.X>
-            
-            -- </e_delete-2.2.X>
-        })
-
-    test:do_delete_tests("e_delete-2.2.2", {
-     {1, [[
-         CREATE TRIGGER aux.tr1 AFTER INSERT ON t8 BEGIN
-           DELETE FROM t9;
-         END;
-         INSERT INTO aux.t8 VALUES(1, 2);
-
-         SELECT count(*) FROM aux.t9 
-           UNION ALL
-         SELECT count(*) FROM aux2.t9;]], {0, 1}},
-    {2, [[
-         CREATE TRIGGER main.tr1 AFTER INSERT ON t8 BEGIN
-           DELETE FROM t7;
-         END;
-         INSERT INTO main.t8 VALUES(1, 2);
-
-         SELECT count(*) FROM temp.t7 
-           UNION ALL
-         SELECT count(*) FROM main.t7
-           UNION ALL
-         SELECT count(*) FROM aux.t7
-           UNION ALL
-         SELECT count(*) FROM aux2.t7;]], {1, 0, 1, 1}}
-    })
-    -- EVIDENCE-OF: R-31567-38587 If the table to which the trigger is
-    -- attached is in the TEMP database, then the unqualified name of the
-    -- table being deleted is resolved in the same way as it is for a
-    -- top-level statement (by searching first the TEMP database, then the
-    -- main database, then any other databases in the order they were
-    -- attached).
-    --
-    test:do_execsql_test(
-        "e_delete-2.3.0",
-        [[
-            DROP TRIGGER aux.tr1;
-            DROP TRIGGER main.tr1;
-            DELETE FROM main.t8 WHERE oid>1;
-            DELETE FROM aux.t8 WHERE oid>1;
-            INSERT INTO aux.t9 VALUES(1, 2);
-            INSERT INTO main.t7 VALUES(3, 4);
-        ]], {
-            -- <e_delete-2.3.0>
-            
-            -- </e_delete-2.3.0>
-        })
-
-    test:do_execsql_test(
-        "e_delete-2.3.1",
-        [[
-            SELECT count(*) FROM temp.t7 UNION ALL SELECT count(*) FROM main.t7 UNION ALL
-            SELECT count(*) FROM aux.t7  UNION ALL SELECT count(*) FROM aux2.t7;
-
-            SELECT count(*) FROM main.t8 UNION ALL SELECT count(*) FROM aux.t8  
-            UNION ALL SELECT count(*) FROM aux2.t8;
-
-            SELECT count(*) FROM aux.t9  UNION ALL SELECT count(*) FROM aux2.t9;
-
-            SELECT count(*) FROM aux2.t10;
-        ]], {
-            -- <e_delete-2.3.1>
-            1, 1, 1, 1, 1, 1, 1, 1, 1, 1
-            -- </e_delete-2.3.1>
-        })
-
-    test:do_execsql_test(
-        "e_delete-2.3.2",
-        [[
-            CREATE TRIGGER temp.tr1 AFTER INSERT ON t7 BEGIN
-              DELETE FROM t7;
-              DELETE FROM t8;
-              DELETE FROM t9;
-              DELETE FROM t10;
-            END;
-            INSERT INTO temp.t7 VALUES('hello', 'world');
-        ]], {
-            -- <e_delete-2.3.2>
-            
-            -- </e_delete-2.3.2>
-        })
-
-    test:do_execsql_test(
-        "e_delete-2.3.3",
-        [[
-            SELECT count(*) FROM temp.t7 UNION ALL SELECT count(*) FROM main.t7 UNION ALL
-            SELECT count(*) FROM aux.t7  UNION ALL SELECT count(*) FROM aux2.t7;
-
-            SELECT count(*) FROM main.t8 UNION ALL SELECT count(*) FROM aux.t8  
-            UNION ALL SELECT count(*) FROM aux2.t8;
-
-            SELECT count(*) FROM aux.t9  UNION ALL SELECT count(*) FROM aux2.t9;
-
-            SELECT count(*) FROM aux2.t10;
-        ]], {
-            -- <e_delete-2.3.3>
-            0, 1, 1, 1, 0, 1, 1, 0, 1, 0
-            -- </e_delete-2.3.3>
-        })
-
-    -- EVIDENCE-OF: R-28691-49464 The INDEXED BY and NOT INDEXED clauses are
-    -- not allowed on DELETE statements within triggers.
-    --
-    test:do_execsql_test(
-        "e_delete-2.4.0",
-        [[
-            CREATE INDEX i8 ON t8(a, b);
-        ]], {
-            -- <e_delete-2.4.0>
-            
-            -- </e_delete-2.4.0>
-        })
-
-    test:do_delete_tests("e_delete-2.4", "-error", [[
-     the %s %s clause is not allowed on UPDATE or DELETE statements within triggers
-   ]], {
-     {1, [[
-       CREATE TRIGGER tr3 AFTER INSERT ON t8 BEGIN
-         DELETE FROM t8 INDEXED BY i8 WHERE a=5;
-       END]], {"INDEXED BY"}},
-    {2, [[
-       CREATE TRIGGER tr3 AFTER INSERT ON t8 BEGIN
-         DELETE FROM t8 NOT INDEXED WHERE a=5;
-       END;]], {"NOT INDEXED"}},
-    })
-end
 
 test:finish_test()
-- 
2.20.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-07 19:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-07 18:17 [tarantool-patches] [PATCH] sql: remove tests on stmts with 'db table' Ivan Koptelov
2019-02-07 18:52 ` [tarantool-patches] " n.pettik
2019-02-07 19:19   ` [tarantool-patches] " i.koptelov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox