From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 2A84726C98 for ; Thu, 5 Jul 2018 07:48:49 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lhEsVNskEBD4 for ; Thu, 5 Jul 2018 07:48:49 -0400 (EDT) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 9D26823C97 for ; Thu, 5 Jul 2018 07:48:48 -0400 (EDT) Received: by mail-lj1-f193.google.com with SMTP id r13-v6so6428853ljg.10 for ; Thu, 05 Jul 2018 04:48:48 -0700 (PDT) MIME-Version: 1.0 References: <1530787337-18302-1-git-send-email-hollow653@gmail.com> In-Reply-To: <1530787337-18302-1-git-send-email-hollow653@gmail.com> From: Nikita Tatunov Date: Thu, 5 Jul 2018 14:48:35 +0300 Message-ID: Subject: [tarantool-patches] Re: [PATCH] sql: Remove 'BEGIN TRANSACTION' Content-Type: multipart/alternative; boundary="00000000000045895705703f21d6" Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: alexander.turenko@tarantool.org --00000000000045895705703f21d6 Content-Type: text/plain; charset="UTF-8" Forgot tests, sorry. Here they are: diff --git a/test/sql-tap/start-transaction.test.lua b/test/sql-tap/start-transaction.test.lua new file mode 100755 index 0000000..a2a622e --- /dev/null +++ b/test/sql-tap/start-transaction.test.lua @@ -0,0 +1,147 @@ +#!/usr/bin/env tarantool +test = require("sqltester") +test:plan(10) + +test:do_catchsql_test( + "start-transaction-1.0", + [[ + BEGIN; + CREATE TABLE IF NOT EXISTS t(id int PRIMARY KEY); + COMMIT; + ]], { + -- + 1, "near \"BEGIN\": syntax error" + -- + }) + +test:do_catchsql_test( + "start-transaction-1.1", + [[ + BEGIN TRANSACTION; + CREATE TABLE IF NOT EXISTS t(id int PRIMARY KEY); + COMMIT; + ]], { + -- + 1, "near \"BEGIN\": syntax error" + -- + }) + +test:do_catchsql_test( + "start-transaction-1.2", + [[ + CREATE TABLE IF NOT EXISTS t(id int PRIMARY KEY); + START TRANSACTION; + INSERT INTO t VALUES (1); + DELETE FROM t; + COMMIT; + ]], { + -- + 0 + -- + }) + +test:do_catchsql_test( + "start-transaction-1.3", + [[ + START TRANSACTION; + INSERT INTO t VALUES (1); + DELETE FROM t; + COMMIT TRANSACTION; + ]], { + -- + 1, "keyword \"TRANSACTION\" is reserved" + -- + }) + +test:do_catchsql_test( + "start-transaction-1.4", + [[ + COMMIT; + START TRANSACTION; + INSERT INTO t VALUES (1); + DELETE FROM t; + END; + ]], { + -- + 1, "keyword \"END\" is reserved" + -- + }) + +test:do_catchsql_test( + "start-transaction-1.5", + [[ + COMMIT; + START TRANSACTION; + INSERT INTO t VALUES (1); + DELETE FROM t; + END TRANSACTION; + ]], { + -- + 1, "keyword \"END\" is reserved" + -- + }) + +test:do_catchsql_test( + "start-transaction-1.6", + [[ + COMMIT; + START TRANSACTION; + INSERT INTO t VALUES (1); + DELETE FROM t; + ROLLBACK; + ]], { + -- + 0 + -- + }) + +test:do_catchsql_test( + "start-transaction-1.7", + [[ + START TRANSACTION; + INSERT INTO t VALUES (1); + DELETE FROM t; + ROLLBACK TRANSACTION; + COMMIT; + ]], { + -- + 1, "keyword \"TRANSACTION\" is reserved" + -- + }) + +test:do_catchsql_test( + "start-transaction-1.8", + [[ + COMMIT; + START TRANSACTION; + INSERT INTO t VALUES (1); + DELETE FROM t; + SAVEPOINT s1; + INSERT INTO t VALUES (2); + DELETE FROM t; + ROLLBACK TO s1; + COMMIT; + ]], { + -- + 0 + -- + }) + +test:do_catchsql_test( + "start-transaction-1.9", + [[ + START TRANSACTION; + INSERT INTO t VALUES (1); + DELETE FROM t; + SAVEPOINT s1; + INSERT INTO t VALUES (2); + DELETE FROM t; + ROLLBACK TRANSACTION TO s1; + COMMIT; + ]], { + -- + 1, "keyword \"TRANSACTION\" is reserved" + -- + }) + +test:finish_test() --00000000000045895705703f21d6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Forgot tests, sorry.
Here they are:


dif= f --git a/test/sql-tap/start-transaction.test.lua b/test/sql-tap/start-tran= saction.test.lua
new file mode 100755
index 0000000..a2= a622e
--- /dev/null
+++ b/test/sql-tap/start-transactio= n.test.lua
@@ -0,0 +1,147 @@
+#!/usr/bin/env tarantool<= /div>
+test =3D require("sqltester")
+test:plan(10)=
+
+test:do_catchsql_test(
+ "start-transaction-1.0",
+ [[
+ BEGIN;
+ C= REATE TABLE IF NOT EXISTS t(id int PRIMARY KEY);
+ COMMIT;
+ ]], {
+ -- <s= tart-transaction-1.0>
+ 1, "near \"BEGIN\": syntax error"
+ -- <start-transaction-1.0>
+= })
+
+test:do_c= atchsql_test(
+ "star= t-transaction-1.1",
+ [[
+ BEGIN TRANSACTION;<= /div>
+ CREATE TABLE IF NOT EX= ISTS t(id int PRIMARY KEY);
+ COMMIT;
+ ]], {
=
+ -- <start-transaction-1.1&= gt;
+ 1, "near \"= ;BEGIN\": syntax error"
+ -- <start-transaction-1.1>
+ })
+
+test:do_catchsql_test(
+ "start-transaction-1.2&quo= t;,
+ [[
+ CREATE TABLE IF NOT EXISTS t(id int PRIM= ARY KEY);
+ START TRANSAC= TION;
+ INSERT INTO t VA= LUES (1);
+ DELETE FROM = t;
+ COMMIT;
+<= span style=3D"white-space:pre"> ]], {
+ -- <start-transaction-1.2>
+ 0
+= -- <start-transaction-1.2>
+ })
+
+test:do_catchsql_test(
+ "start-transaction-1.3"= ,
+ [[
+ START TRANSACTION;
+ INSERT INTO t VALUES (1);
+ DELETE FROM t;
+ COMMIT TRANSACTION;
+ ]], {
+ -- <start-transaction-1.3>
+ 1, "keyword \"TRANSACTION\" is reserved"<= /div>
+ -- <start-transaction= -1.3>
+ })
+<= /div>
+test:do_catchsql_test(
+ "start-transaction-1.4",
+ [[
+ COMMIT;
+ START TRANSACT= ION;
+ INSERT INTO t VAL= UES (1);
+ DELETE FROM t= ;
+ END;
+ ]], {
+ -- <start-transaction-1.4>
+ 1, "keyword \"END\" is reserved&qu= ot;
+ -- <start-transac= tion-1.4>
+ })
+
+test:do_catchsql_test(
+ "start-transaction-1.5",
+ [[
+ COMMIT;
+ START TRAN= SACTION;
+ INSERT INTO t= VALUES (1);
+ DELETE FR= OM t;
+ END TRANSACTION;<= /div>
+ ]], {
+ -- <start-transaction-1.5>
+ 1, "keyword \"END\"= ; is reserved"
+ -- &= lt;start-transaction-1.5>
+ })
+
+test:do_catchsql_test(
+ "start-transaction-1.6",
= + [[
+ COMMIT;
+ <= /span>START TRANSACTION;
+ INSERT INTO t VALUES (1);
+ = DELETE FROM t;
+ = ROLLBACK;
+ ]], {
+ -- <start-transaction-1.6>=
+ 0
+ -- <start-transaction-1.6>
+<= span style=3D"white-space:pre"> })
+
+test:do_ca= tchsql_test(
+ "start= -transaction-1.7",
+ = [[
+ START TRANSACTION;
+ INSERT INTO t VALUES (1= );
+ DELETE FROM t;
+ ROLLBACK TRANSACTION;
+ COMMIT;
+ ]], {
+ -- <start-transaction-1.7>
+ 1, "keyword \"TRANSACTION\" is reserv= ed"
+ -- <start-tr= ansaction-1.7>
+ })
+
+test:do_catchsql_test(
+ "start-transaction-1.8",
+ [[
+ COMMIT;
+ START= TRANSACTION;
+ INSERT I= NTO t VALUES (1);
+ DELE= TE FROM t;
+ SAVEPOINT s= 1;
+ INSERT INTO t VALUE= S (2);
+ DELETE FROM t;<= /div>
+ ROLLBACK TO s1;
<= div>+ COMMIT;
+ ]], {
+ -- <start-transaction-1.8>
+ 0
+ -= - <start-transaction-1.8>
+= })
+
+test:do_catchsql_test(
+ "start-transaction-1.9",
+ [[
+ START TRANSACTION;
+ INSERT INTO t VALUES (1);
+ DELETE FROM t;
+ SAVEPOINT s1;
+= INSERT INTO t VALUES (2);
+ DELETE FROM t;
+ = ROLLBACK TRANSACTION TO s1;
+ COMMIT;
+ ]], = {
+ -- <start-transacti= on-1.9>
+ 1, "keyw= ord \"TRANSACTION\" is reserved"
+ -- <start-transaction-1.9>
+ })
+
+test:finish_test= ()
--00000000000045895705703f21d6--