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 57FEF24C29 for ; Fri, 8 Feb 2019 09:22:36 -0500 (EST) 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 dM5C53BiFMoV for ; Fri, 8 Feb 2019 09:22:36 -0500 (EST) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 58E5624674 for ; Fri, 8 Feb 2019 09:22:35 -0500 (EST) From: "n.pettik" Message-Id: <6FCAB637-5974-40F7-8003-A8E52C57AA69@tarantool.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_32A80764-F756-4B8F-8F20-DF28E2067D5B" Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: [tarantool-patches] Re: [PATCH] sql: remove tests on ORDER BY/LIMIT + DELETE Date: Fri, 8 Feb 2019 17:22:32 +0300 In-Reply-To: <881E38B4-BEEB-46F9-B2AE-4F8053A9B602@tarantool.org> References: <20190204153458.12559-1-ivan.koptelov@tarantool.org> <02101d10-cf70-d974-ee0b-0f66166c73ca@tarantool.org> <3F901C89-5E42-44FF-9114-128C4522B32C@tarantool.org> <881E38B4-BEEB-46F9-B2AE-4F8053A9B602@tarantool.org> 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: Ivan Koptelov , Kirill Yukhin --Apple-Mail=_32A80764-F756-4B8F-8F20-DF28E2067D5B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 7 Feb 2019, at 21:54, n.pettik wrote: >=20 > LGTM. Oh, my apologies, I forget that I've already removed this define and = tests connected with it: = https://github.com/tarantool/tarantool/commit/43ed060f9539ed44a232ca81ad89= 0b1099872cd9 I=E2=80=99m really sorry, we should skip this patch. >> On 7 Feb 2019, at 20:45, i.koptelov > wrote: >>=20 >>>>=20 >>>> On 4 Feb 2019, at 22:11, Ivan Koptelov > wrote: >>>>>> On 4 Feb 2019, at 18:34, Ivan Koptelov = > >>>>>> wrote: >>>>>>=20 >>>>>> Removes obsolete tests on ORDER BY/LIMIT + DELETE. This >>>>>> functionality was not supported for some time, but a few tests >>>>>> were still existing. >>>>>>=20 >>>>>> Closes #2172 >>>>>> --- >>>>>> Branch=20 >>>>>> = https://github.com/tarantool/tarantool/compare/sudobobo/gh-2172-rm-order-b= y-and-limit-from-delete = >>>>>>=20 >>>>>> Issue=20 >>>>>> https://github.com/tarantool/tarantool/issues/2172 >>>>>>=20 >>>>>>=20 >>>>>> test/sql-tap/e_delete.test.lua | 188 = ----------------------------------------- >>>>>> 1 file changed, 188 deletions(-) >>>>>>=20 >>>>>> diff --git a/test/sql-tap/e_delete.test.lua = b/test/sql-tap/e_delete.test.lua >>>>>> index 84a4e0a22..0a81eb3bd 100755 >>>>>> --- a/test/sql-tap/e_delete.test.lua >>>>>> +++ b/test/sql-tap/e_delete.test.lua >>>>>> @@ -305,194 +305,6 @@ if (0 > 0) then >>>>>> DELETE FROM t8 NOT INDEXED WHERE a=3D5; >>>>>> END;]], {"NOT INDEXED"}}, >>>>>> }) >>>>>> - -- EVIDENCE-OF: R-64942-06615 The LIMIT and ORDER BY clauses = (described >>>>>> - -- below) are unsupported for DELETE statements within = triggers. >>>>>> - =E2=80=94 >>>>>>=20 >>>>> If I=E2=80=99m not mistaken, tests starting from e_delete-2.0 are = disabled >>>>> (under if 0 > 0). So you can delete even more tests. >>>>>=20 >>>> I thought we could enable this tests later? >>>=20 >>> Could you please examine those tests. If they are valid, simply = uncomment them. >>> If not so - remove. Do it in a separate patch/commit pls. >> They are not valid and test functionality we don=E2=80=99t have. I = would send a separate small patch >> with removing these tests. >>=20 >>>>> Also, check SQLITE_ENABLE_UPDATE_DELETE_LIMIT define: >>>>> I guess it is related to this patch. Seems that it is turned off, = so I >>>>> assume we can delete it alongside with code under it. =20 >>>>>=20 >>>> Yes, it turned off currently, but it may be turned on. This option = also enables >>>> UPDATE + LIMIT/ORDER BY statements and all code under 'define' = appplies >>>> to this functionality as well, so firstly I decided not to delete = it.=20 >>>=20 >>> I really doubt that some day we will do it. LIMIT is non-ansi = extension. >>> For example Oracle doesn=E2=80=99t support it at all. I guess this = is a reason >>> why we got rid of delete+limit. Lets remove it as well. >> Done. >>=20 >> diff --git a/src/box/sql/parse.y b/src/box/sql/parse.y >> index 0bcf41594..646e95ebe 100644 >> --- a/src/box/sql/parse.y >> +++ b/src/box/sql/parse.y >> @@ -727,7 +727,6 @@ where_opt(A) ::=3D WHERE expr(X). {A =3D = X.pExpr;} >>=20 >> ////////////////////////// The UPDATE command = //////////////////////////////// >> // >> -%ifndef SQLITE_ENABLE_UPDATE_DELETE_LIMIT >> cmd ::=3D with(C) UPDATE orconf(R) fullname(X) indexed_opt(I) SET = setlist(Y) >> where_opt(W). { >> sqlite3WithPush(pParse, C, 1); >> @@ -738,7 +737,6 @@ cmd ::=3D with(C) UPDATE orconf(R) fullname(X) = indexed_opt(I) SET setlist(Y) >> pParse->initiateTTrans =3D true; >> sqlite3Update(pParse,X,Y,W,R); >> } >> -%endif >>=20 >> %type setlist {ExprList*} >> %destructor setlist {sql_expr_list_delete(pParse->db, $$);} >> diff --git a/src/box/sql/resolve.c b/src/box/sql/resolve.c >> index 6462467bc..4c6baaac6 100644 >> --- a/src/box/sql/resolve.c >> +++ b/src/box/sql/resolve.c >> @@ -579,26 +579,6 @@ resolveExprStep(Walker * pWalker, Expr * pExpr) >> } >> #endif >> switch (pExpr->op) { >> - >> -#if defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT) >> - /* The special operator TK_ROW means use the rowid for = the first >> - * column in the FROM clause. This is used by the LIMIT = and ORDER BY >> - * clause processing on UPDATE and DELETE statements. >> - */ >> - case TK_ROW:{ >> - SrcList *pSrcList =3D pNC->pSrcList; >> - struct SrcList_item *pItem; >> - assert(pSrcList && pSrcList->nSrc =3D=3D 1); >> - pItem =3D pSrcList->a; >> - pExpr->op =3D TK_COLUMN; >> - pExpr->pTab =3D pItem->pTab; >> - pExpr->iTable =3D pItem->iCursor; >> - pExpr->iColumn =3D -1; >> - pExpr->affinity =3D AFFINITY_INTEGER; >> - break; >> - } >> -#endif /* = defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT) */ >> - >> /* A lone identifier is the name of a column. >> */ >> case TK_ID:{ >=20 --Apple-Mail=_32A80764-F756-4B8F-8F20-DF28E2067D5B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On 7 Feb 2019, at 21:54, n.pettik <korablev@tarantool.org> wrote:

LGTM.

Oh, = my apologies, I forget that I've already removed this define and = tests
connected with it:

I=E2=80=99= m really sorry, we should skip this patch.

On 7 Feb 2019, at 20:45, i.koptelov <ivan.koptelov@tarantool.org> wrote:


On 4 Feb 2019, at 22:11, Ivan = Koptelov <ivan.koptelov@tarantool.org> wrote:
On 4 Feb 2019, at 18:34, Ivan Koptelov <ivan.koptelov@tarantool.org>
wrote:

Removes obsolete tests on ORDER BY/LIMIT + = DELETE. This
functionality was not supported for some = time, but a few tests
were still existing.
Closes #2172
---
Branch 
https://github.com/tarantool/tarantool/compare/sudobobo/gh-2172= -rm-order-by-and-limit-from-delete

Issue 
https://github.com/tarantool/tarantool/issues/2172


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

diff --git = a/test/sql-tap/e_delete.test.lua b/test/sql-tap/e_delete.test.lua
index 84a4e0a22..0a81eb3bd 100755
--- = a/test/sql-tap/e_delete.test.lua
+++ = b/test/sql-tap/e_delete.test.lua
@@ -305,194 +305,6 @@ if = (0 > 0) then
        DELETE FROM = t8 NOT INDEXED WHERE a=3D5;
      END;]], {"NOT = INDEXED"}},
   })
- =    -- EVIDENCE-OF: R-64942-06615 The LIMIT and ORDER BY = clauses (described
-    -- below) are = unsupported for DELETE statements within triggers.
- =    =E2=80=94

If = I=E2=80=99m not mistaken, tests starting from e_delete-2.0 are = disabled
(under if 0 > 0). So you can delete even more = tests.

I thought we could = enable this tests later?

Could = you please examine those tests. If they are valid, simply uncomment = them.
If not so - remove. Do it in a separate patch/commit = pls.
They are not valid and test functionality we don=E2=80=99t = have. I would send a separate small patch
with removing these tests.

Also, check = SQLITE_ENABLE_UPDATE_DELETE_LIMIT define:
I guess it is = related to this patch. Seems that it is turned off, so I
assume we can delete it alongside with code under it. =  

Yes, it turned off = currently, but it may be turned on. This option also enables
UPDATE + LIMIT/ORDER BY statements and all code under = 'define' appplies
to this functionality as well, so = firstly I decided not to delete it. 

I really doubt that some day we = will do it. LIMIT is non-ansi extension.
For example = Oracle doesn=E2=80=99t support it at all. I guess this is a reason
why we got rid of delete+limit. Lets remove it as well.
Done.

diff --git a/src/box/sql/parse.y = b/src/box/sql/parse.y
index 0bcf41594..646e95ebe 100644
--- = a/src/box/sql/parse.y
+++ b/src/box/sql/parse.y
@@ -727,7 +727,6 @@ where_opt(A) ::=3D WHERE expr(X). =       {A =3D X.pExpr;}

////////////////////////// The = UPDATE command ////////////////////////////////
//
-%ifndef SQLITE_ENABLE_UPDATE_DELETE_LIMIT
cmd ::=3D with(C) UPDATE = orconf(R) fullname(X) indexed_opt(I) SET setlist(Y)
        where_opt(W). =  {
  sqlite3WithPush(pParse, C, 1);
@@ -738,7 +737,6 @@ cmd ::=3D = with(C) UPDATE orconf(R) fullname(X) indexed_opt(I) SET = setlist(Y)
  pParse->initiateTTrans =3D true;
  sqlite3Update(pParse,X,Y,W,R);
}
-%endif

%type setlist {ExprList*}
%destructor setlist {sql_expr_list_delete(pParse->db, = $$);}
diff --git = a/src/box/sql/resolve.c b/src/box/sql/resolve.c
index 6462467bc..4c6baaac6 = 100644
--- = a/src/box/sql/resolve.c
+++ b/src/box/sql/resolve.c
@@ -579,26 +579,6 @@ resolveExprStep(Walker * pWalker, Expr * = pExpr)
}
#endif
= switch = (pExpr->op) {
-
-#if = defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT)
- = /* The = special operator TK_ROW means use the rowid for the first
-  * column = in the FROM clause.  This is used by the LIMIT and ORDER = BY
-  * clause = processing on UPDATE and DELETE statements.
-  */- case = TK_ROW:{
- = SrcList = *pSrcList =3D pNC->pSrcList;
- = struct = SrcList_item *pItem;
- = assert(pSrcList= && pSrcList->nSrc =3D=3D 1);
- = pItem =3D = pSrcList->a;
- = pExpr->op = =3D TK_COLUMN;
- = pExpr->pTab = =3D pItem->pTab;
- = pExpr->iTable =3D pItem->iCursor;
- = pExpr->iColumn =3D -1;
- = pExpr->affinity =3D AFFINITY_INTEGER;
- = break;
- = }
-#endif = /* = defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT) */
-
= /* A lone = identifier is the name of a column.
=  */
case = TK_ID:{


= --Apple-Mail=_32A80764-F756-4B8F-8F20-DF28E2067D5B--