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 9A52030E7B for ; Sat, 8 Dec 2018 11:50:05 -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 x1u8ySqcgBh6 for ; Sat, 8 Dec 2018 11:50:05 -0500 (EST) Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [94.100.177.92]) (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 0C43130E5F for ; Sat, 8 Dec 2018 11:50:04 -0500 (EST) Subject: [tarantool-patches] Re: [PATCH 0/3 v2] sql: add test for indexed char in sub subquery References: <97B7ED6F-8AD4-47D4-B988-32958A4B1370@tarantool.org> From: roman Message-ID: Date: Sat, 8 Dec 2018 19:49:59 +0300 MIME-Version: 1.0 In-Reply-To: <97B7ED6F-8AD4-47D4-B988-32958A4B1370@tarantool.org> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: en-US 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, "n.pettik" Cc: Vladislav Shpilevoy Hi! Thanks for review. >> 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. Removed. > 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) ::= DATE . { A.type = AFFINITY_REAL; } > typedef(A) ::= TIME . { A.type = AFFINITY_REAL; } > typedef(A) ::= DATETIME . { A.type = AFFINITY_REAL; } > > -%type char_len {int} > -typedef(A) ::= CHAR char_len(B) . { > +typedef(A) ::= CHAR . { > A.type = AFFINITY_TEXT; > - (void) B; > } > > -%type vchar_len {int} > -typedef(A) ::= VARCHAR vchar_len(B) . { > - A.type = AFFINITY_TEXT; > +char_len(A) ::= LP INTEGER(B) RP . { > + (void) A; > (void) B; > } > > -char_len(A) ::= . { > - (void) A; > +typedef(A) ::= CHAR char_len(B) . { > + A.type = AFFINITY_TEXT; > + (void) B; > } > > -char_len(A) ::= vchar_len(A) . > - > -vchar_len(A) ::= LP INTEGER(B) RP . { > - (void) A; > +typedef(A) ::= VARCHAR char_len(B) . { > + A.type = AFFINITY_TEXT; > (void) B; > } > > In this case code looks a bit more straightforward IMHO. Refactored. >>> sql: add test for indexed char in sub subquery > You don’t need to drop and re-create table t2 - > it doesn’t change in half cases. You should drop it > only when you change format of table, but in other > cases it doesn’t affect anything. Fixed.