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 D0E7B30B01 for ; Fri, 7 Dec 2018 10:59:55 -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 zYiVqKHg6YuG for ; Fri, 7 Dec 2018 10:59:55 -0500 (EST) Received: from smtp36.i.mail.ru (smtp36.i.mail.ru [94.100.177.96]) (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 3E4D030AFE for ; Fri, 7 Dec 2018 10:59:55 -0500 (EST) From: "n.pettik" Message-Id: <7278A735-3A4A-46C3-81AC-723C6509E4A7@tarantool.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_3CC76573-6357-40AD-9670-F88DEAB7119B" Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Subject: [tarantool-patches] Re: [PATCH 0/3 v2] sql: add test for indexed char in sub subquery Date: Fri, 7 Dec 2018 18:59:46 +0300 In-Reply-To: <5b722fb0-7c22-f0d2-55ac-f61cfd0f707d@tarantool.org> References: <97B7ED6F-8AD4-47D4-B988-32958A4B1370@tarantool.org> <5b722fb0-7c22-f0d2-55ac-f61cfd0f707d@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: Roman Khabibov , Vladislav Shpilevoy --Apple-Mail=_3CC76573-6357-40AD-9670-F88DEAB7119B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 7 Dec 2018, at 14:27, Vladislav Shpilevoy = wrote: > On 07/12/2018 14:20, n.pettik wrote: >>> On 5 Dec 2018, at 23:35, Vladislav Shpilevoy = wrote: >>>=20 >>> Vova, please, ignore. It was accidentally sent to you. >>>=20 >>> Nikita, please, review. >> I didn=E2=80=99t receive mail since there were issues with our = mailing list, >> so I looked at patch-set on GitHub. >>>=20 >>> On 05/12/2018 02:47, Roman Khabibov wrote: >>>> Branch: = https://github.com/tarantool/tarantool/tree/romanhabibov/gh-3580-err-msg-p= athjoin >>>> Issue: https://github.com/tarantool/tarantool/issues/3580 >>>> Roman Khabibov (2): >>>> sql: add CHAR description without length >>> Fix an ability to describe CHAR without specifying the >> Not =E2=80=98fix=E2=80=99 but rather =E2=80=98add=E2=80=99. = Otherwise, it sounds wierd. >>> length as it is allowed by standard. It was >>> accidentally broken by this commit: >>> 7752cdfd31f9956a4d6bb0f306c561a0ac73e7ab >>> Needed for #3616 >> It is not needed for #3616 - this commit and issue are not connected. >> Issue disappeared after static types were introduced. It is ok that >> you added test case on this issue, but these two problems are not = related. >> Consider refactoring: >> diff --git a/src/box/sql/parse.y b/src/box/sql/parse.y >> index f5e86fba1..d56fce451 100644 >> --- a/src/box/sql/parse.y >> +++ b/src/box/sql/parse.y >> @@ -1485,26 +1485,22 @@ typedef(A) ::=3D DATE . { A.type =3D = AFFINITY_REAL; } >> typedef(A) ::=3D TIME . { A.type =3D AFFINITY_REAL; } >> typedef(A) ::=3D DATETIME . { A.type =3D AFFINITY_REAL; } >> -%type char_len {int} >> -typedef(A) ::=3D CHAR char_len(B) . { >> +typedef(A) ::=3D CHAR . { >> A.type =3D AFFINITY_TEXT; >> - (void) B; >> } >> -%type vchar_len {int} >> -typedef(A) ::=3D VARCHAR vchar_len(B) . { >> - A.type =3D AFFINITY_TEXT; >> +char_len(A) ::=3D LP INTEGER(B) RP . { >> + (void) A; >> (void) B; >> } >> -char_len(A) ::=3D . { >> - (void) A; >> +typedef(A) ::=3D CHAR char_len(B) . { >> + A.type =3D AFFINITY_TEXT; >> + (void) B; >> } >> -char_len(A) ::=3D vchar_len(A) . >> - >> -vchar_len(A) ::=3D LP INTEGER(B) RP . { >> - (void) A; >> +typedef(A) ::=3D VARCHAR char_len(B) . { >> + A.type =3D AFFINITY_TEXT; >> (void) B; >> } >> In this case code looks a bit more straightforward IMHO. >=20 > I've tried this refactoring too but faced with > grammar 'features'. You can not define two rules > starting with the same prefix. Did you test it? Maybe > I was wrong? Yep, I tested - it works. --Apple-Mail=_3CC76573-6357-40AD-9670-F88DEAB7119B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On 7 Dec 2018, at 14:27, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wrote:
On 07/12/2018 = 14:20, n.pettik wrote:
On= 5 Dec 2018, at 23:35, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wrote:

Vova, please, ignore. It was accidentally sent to you.

Nikita, please, review.
I didn=E2=80=99t receive mail since there were = issues with our mailing list,
so I looked at patch-set on = GitHub.

On 05/12/2018 02:47, Roman Khabibov wrote:
Branch: https://github.com/tarantool/tarantool/tree/romanhabibov/gh-358= 0-err-msg-pathjoin
Issue: https://github.com/tarantool/tarantool/issues/3580
Roman Khabibov (2):
  sql: add CHAR = description without length
    Fix an ability to describe CHAR = without specifying the
Not =E2=80=98fix=E2=80=99= but rather =E2=80=98add=E2=80=99. Otherwise, it sounds wierd.
    length as it is allowed by standard. = It was
    accidentally broken by this = commit:
    7752cdfd31f9956a4d6bb0f306c561a0ac73e7a= b
         Needed = for #3616
It is not needed for #3616 - this = commit and issue are not connected.
Issue disappeared = after static types were introduced. It is ok that
you = added test case on this issue, but these two problems are not = related.
Consider refactoring:
diff --git = a/src/box/sql/parse.y b/src/box/sql/parse.y
index = f5e86fba1..d56fce451 100644
--- a/src/box/sql/parse.y
+++ b/src/box/sql/parse.y
@@ -1485,26 +1485,22 = @@ typedef(A) ::=3D DATE . { A.type =3D AFFINITY_REAL; }
 typedef(A) ::=3D TIME . { A.type =3D AFFINITY_REAL; = }
 typedef(A) ::=3D DATETIME . { A.type =3D = AFFINITY_REAL; }
 -%type char_len {int}
-typedef(A) ::=3D CHAR char_len(B) . {
+typedef(A) ::=3D CHAR . {
   A.type =3D AFFINITY_TEXT;
- =  (void) B;
 }
 -%type = vchar_len {int}
-typedef(A) ::=3D VARCHAR vchar_len(B) . = {
-  A.type =3D AFFINITY_TEXT;
+char_len(A) ::=3D LP INTEGER(B) RP . {
+ =  (void) A;
   (void) B;
 }
 -char_len(A) ::=3D  . {
-  (void) A;
+typedef(A) ::=3D CHAR = char_len(B) . {
+  A.type =3D AFFINITY_TEXT;
+  (void) B;
 }
 -char_len(A) ::=3D  vchar_len(A) .
-
-vchar_len(A) ::=3D LP INTEGER(B) RP . {
-  (void) A;
+typedef(A) ::=3D VARCHAR = char_len(B) . {
+  A.type =3D AFFINITY_TEXT;
   (void) B;
 }
In this case code looks a bit more straightforward IMHO.

I've tried this refactoring too but faced with
grammar 'features'. You can not = define two rules
starting with the same prefix. Did you test it? = Maybe
I was = wrong?

Yep, I = tested - it works.

= --Apple-Mail=_3CC76573-6357-40AD-9670-F88DEAB7119B--