From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [94.100.177.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id D6B8B42EF5C for ; Thu, 2 Jul 2020 00:25:50 +0300 (MSK) References: <20200611151853.24398-1-roman.habibov@tarantool.org> <20200611151853.24398-2-roman.habibov@tarantool.org> <81127D96-BB22-4F99-A788-047F9327A4AE@tarantool.org> <3e040934-d6dc-200b-5925-04879fea3e83@tarantool.org> <0B6AD22C-DC0E-441C-B84E-9667A0AED2C3@tarantool.org> <54353233-4232-5964-414d-2115f18b2ac1@tarantool.org> <85577B34-6715-4D28-9C03-9182C36CD3D9@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Wed, 1 Jul 2020 23:25:48 +0200 MIME-Version: 1.0 In-Reply-To: <85577B34-6715-4D28-9C03-9182C36CD3D9@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v3 1/2] sql: use unify pattern for column names List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Roman Khabibov Cc: tarantool-patches@dev.tarantool.org >>> +test:do_execsql2_test( >>> + "colname-12.5", >>> + [[ >>> + CREATE TABLE j (s1 SCALAR PRIMARY KEY); >>> + INSERT INTO j VALUES(1); >>> + ]], {}) >>> + >>> +-- >>> +-- Column named as 'COLUMN_1', because 's1 + 1' is a expression. >>> +-- >>> +test:do_execsql2_test( >>> + "colname-12.6", >>> + [[ >>> + SELECT s1 + 1 FROM j; >>> + ]], { >>> + "COLUMN_1",2 >>> + }) >>> + >>> +test:do_execsql2_test( >>> + "colname-12.7", >>> + [[ >>> + SELECT s1 + 1 FROM j ORDER BY column_1; >>> + ]], { >>> + "COLUMN_1",2 >>> + }) >>> + >>> +test:do_execsql2_test( >>> + "colname-12.8", >>> + [[ >>> + SELECT * FROM (SELECT s1 + 1 FROM j >>> + ORDER BY column_1) ORDER BY column_1; >>> + ]], { >>> + "COLUMN_1",2 >>> + }) >>> + >>> +test:do_execsql2_test( >>> + "colname-12.9", >>> + [[ >>> + SELECT s1 + 1 FROM j GROUP BY column_1; >>> + ]], { >>> + "COLUMN_1",2 >>> + }) >>> + >>> +test:do_execsql2_test( >>> + "colname-12.10", >>> + [[ >>> + SELECT * FROM (SELECT s1 + 1 FROM j >>> + ORDER BY column_1) GROUP BY column_1; >>> + ]], { >>> + "COLUMN_1",2 >>> + }) >>> + >>> +test:do_execsql2_test( >>> + "colname-12.11", >>> + [[ >>> + SELECT * FROM (SELECT s1 + 1 FROM j >>> + ORDER BY column_1) WHERE column_1 = 2; >>> + ]], { >>> + "COLUMN_1",2 >>> + }) >>> + >>> +test:do_execsql2_test( >>> + "colname-12.12", >>> + [[ >>> + SELECT *, s1 + 1 FROM j ORDER BY column_1; >>> + ]], { >>> + "S1",1,"COLUMN_1",2 >>> + }) >>> + >>> +test:do_execsql2_test( >>> + "colname-12.13", >>> + [[ >>> + SELECT s1 + 1, * FROM j ORDER BY column_1; >>> + ]], { >>> + "COLUMN_1",2,"S1",1 >>> + }) >>> + >>> +test:do_execsql2_test( >>> + "colname-12.14", >>> + [[ >>> + CREATE TABLE j_1 (column_1 SCALAR PRIMARY KEY, column_2 SCALAR); >>> + INSERT INTO j_1 VALUES(1, 1); >>> + ]], {}) >>> + >>> +test:do_execsql2_test( >>> + "colname-12.15", >>> + [[ >>> + SELECT column_1, column_1 + 1, column_2, 2 FROM j_1; >>> + ]], { >>> + "COLUMN_1",1,"COLUMN_1",2,"COLUMN_2",1,"COLUMN_2",2 >>> + }) >>> + >> >> Is there a test on how ORDER BY selects a column? > Did you mean this? If it is not a bug, we should document that, because > because this is not obvious behavior, IMO. Yes, I mean this. It does not depend on whether this is a bug. If something is a bug, or is not documented, it does not mean it shouldn't be tested. You can add this to the doc request.