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 BA52620331 for ; Sat, 5 May 2018 15:15:08 -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 6zVyJRkHX2jf for ; Sat, 5 May 2018 15:15:08 -0400 (EDT) Received: from smtp34.i.mail.ru (smtp34.i.mail.ru [94.100.177.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 7AD131F922 for ; Sat, 5 May 2018 15:15:08 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [tarantool-patches] Re: [PATCH 3/4] sql: allow SAVEPOINT statement outside transaction From: "n.pettik" In-Reply-To: Date: Sat, 5 May 2018 22:15:06 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: 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: Vladislav Shpilevoy > 1. Lets use diag_set(ClientError, ER_SAVEPOINT_NO_TRANSACTION) and = return TARANTOOL_ERROR. > It must behave like box.savepoint. Ok: @@ -2869,9 +2869,8 @@ case OP_Savepoint: { =20 if (psql_txn =3D=3D NULL) { assert(!box_txn()); - sqlite3VdbeError(p, "cannot process savepoint: " - "there is no active transaction"); - rc =3D SQLITE_ERROR; + diag_set(ClientError, ER_SAVEPOINT_NO_TRANSACTION); + rc =3D SQL_TARANTOOL_ERROR; >> diff --git a/test/sql/gh-3313-savepoints-outside-txn.result = b/test/sql/gh-3313-savepoints-outside-txn.result >> new file mode 100644 >> index 000000000..702d3e815 >> --- /dev/null >> +++ b/test/sql/gh-3313-savepoints-outside-txn.result >> @@ -0,0 +1,32 @@ >> +test_run =3D require('test_run').new() >> +--- >> +... >> +test_run:cmd("setopt delimiter ';'") >=20 > 2. Why do you need here a special delimiter? Your test does not > contain multi-line statements. Sorry, it is garbage after copying files. Removed. >> +--- >> +- true >> +... >> +-- These tests check that SQL savepoints properly work outside >> +-- transactions as well as inside transactions started in Lua. >> +-- >> +-- box.cfg() >=20 > 3. Garbage comment. Removed. Also, taking into consideration comment from review of last patch, I have renamed test file and merge tests from both tickets.