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 EF40530D27 for ; Tue, 25 Jun 2019 17:40:39 -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 JssbH08TqtCl for ; Tue, 25 Jun 2019 17:40:39 -0400 (EDT) Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [217.69.128.40]) (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 07C1430CA2 for ; Tue, 25 Jun 2019 17:40:38 -0400 (EDT) From: "n.pettik" Message-Id: <2501E75F-D71B-4C4F-8CA0-7F102A9B9389@tarantool.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_2A4FF3C5-B214-4468-B3AF-3C6566CFA37E" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: [tarantool-patches] Re: [PATCH v1 1/1] sql: create CHAR_LENGTH() and CHARACTER_LENGTH() Date: Wed, 26 Jun 2019 00:40:35 +0300 In-Reply-To: <20190615144551.GA31739@tarantool.org> References: <7b8049e47b931a2014b92e26436dc264d56231c9.1557321237.git.imeevma@gmail.com> <78A05ED7-1BE9-4DF6-A96C-AD763D7CC969@tarantool.org> <20190529175752.GA22262@tarantool.org> <20190615144551.GA31739@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: Imeev Mergen --Apple-Mail=_2A4FF3C5-B214-4468-B3AF-3C6566CFA37E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > First patch: >=20 > =46rom 3702718fcf9da52a27bebd5db67a3428b98a093d Mon Sep 17 00:00:00 = 2001 > Date: Fri, 14 Jun 2019 18:55:51 +0300 > Subject: [PATCH] sql: make LENGTH() to accept only strings >=20 > Prior to this patch, LENGTH() could accept arguments other than > strings. Since this function is considered to be the CHAR_LENGTH() > function from the ANSI standard, this is incorrect. This patch > corrects the behavior of the LENGTH() function. >=20 > Part of #3929 > Part of #4159 This is OK. > Second patch: >=20 > =46rom 2db336d071f5ab2c1380961df6c0234d16af77d3 Mon Sep 17 00:00:00 = 2001 > Date: Sat, 15 Jun 2019 13:51:58 +0300 > Subject: [PATCH] sql: ANSI aliases for LENGTH(). >=20 > This patch creates CHARACTER_LENGTH() and CHAR_LENGTH() aliases > for LENGTH(). >=20 > Closes #3929 >=20 > @TarantoolBot document > Title: SQL functions LENGTH(), CHAR_LENGTH() and CHARACTER_LENGTH() >=20 > The SQL functions LENGTH(), CHAR_LENGTH() and CHARACTER_LENGTH() > take exactly one argument. If the argument is of type TEXT, then > they return its length. If the argument is NULL, they return NULL. > They throw an error if the argument is of a different type or if > more than one argument is given. >=20 > diff --git a/test/sql-tap/func3.test.lua b/test/sql-tap/func3.test.lua > index 3832cac..f5f5bba 100755 > --- a/test/sql-tap/func3.test.lua > +++ b/test/sql-tap/func3.test.lua > @@ -1,6 +1,6 @@ > #!/usr/bin/env tarantool > test =3D require("sqltester") > -test:plan(30) > +test:plan(58) >=20 > --!./tcltestrunner.lua > -- 2010 August 27 > @@ -337,5 +337,269 @@ test:do_execsql_test( > -- > }) >=20 > + -- > +-- gh-3929: sql: ANSI aliases for LENGTH(). > +=E2=80=94 I=E2=80=99d (IMHO) say you added too many tests. Especially taking into consideration the fact that under the hood these functions feature the same implementation. --Apple-Mail=_2A4FF3C5-B214-4468-B3AF-3C6566CFA37E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

First patch:

=46rom 3702718fcf9da52a27bebd5db67a3428b98a093d Mon Sep 17 = 00:00:00 2001
Date: Fri, 14 = Jun 2019 18:55:51 +0300
Subject: [PATCH] sql: make LENGTH() to accept only = strings

Prior to this = patch, LENGTH() could accept arguments other than
strings. Since this function is = considered to be the CHAR_LENGTH()
function from the ANSI standard, this is incorrect. This = patch
corrects the = behavior of the LENGTH() function.

Part of #3929
Part of #4159

This is OK.

Second patch:

=46rom 2db336d071f5ab2c1380961df6c0234d16af77d3 Mon Sep 17 = 00:00:00 2001
Date: Sat, 15 = Jun 2019 13:51:58 +0300
Subject: [PATCH] sql: ANSI aliases for LENGTH().

This patch creates = CHARACTER_LENGTH() and CHAR_LENGTH() aliases
for LENGTH().

Closes #3929

@TarantoolBot document
Title: SQL functions LENGTH(), = CHAR_LENGTH() and CHARACTER_LENGTH()

The SQL functions LENGTH(), CHAR_LENGTH() and = CHARACTER_LENGTH()
take exactly one argument. If the argument is of type TEXT, = then
they return = its length. If the argument is NULL, they return NULL.
They throw an error if the = argument is of a different type or if
more than one argument is given.

diff --git = a/test/sql-tap/func3.test.lua b/test/sql-tap/func3.test.lua
index 3832cac..f5f5bba = 100755
--- = a/test/sql-tap/func3.test.lua
+++ b/test/sql-tap/func3.test.lua
@@ -1,6 +1,6 @@
#!/usr/bin/env = tarantool
test =3D = require("sqltester")
-test:plan(30)
+test:plan(58)

--!./tcltestrunner.lua
-- 2010 August 27
@@ -337,5 +337,269 @@ test:do_execsql_test(
        -- = </func3-6.5>
    })

+ --
+-- gh-3929: sql: ANSI aliases for LENGTH().
+=E2=80=94

I=E2=80=99d (IMHO) say you added too many tests. = Especially taking into
consideration the fact that under the = hood these functions feature
the same implementation.

= --Apple-Mail=_2A4FF3C5-B214-4468-B3AF-3C6566CFA37E--