From: "n.pettik" <korablev@tarantool.org> To: tarantool-patches@freelists.org Cc: Imeev Mergen <imeevma@tarantool.org> Subject: [tarantool-patches] Re: [PATCH v1 1/1] sql: create CHAR_LENGTH() and CHARACTER_LENGTH() Date: Thu, 6 Jun 2019 21:55:31 +0300 [thread overview] Message-ID: <FF90595F-F460-416F-9E2D-B533B97243BA@tarantool.org> (raw) In-Reply-To: <20190529175752.GA22262@tarantool.org> > On 29 May 2019, at 20:57, Mergen Imeev <imeevma@tarantool.org> wrote: > > Hi! Thank you for review! My answers and new version below. > > On Tue, May 21, 2019 at 03:58:55PM +0300, n.pettik wrote: >> >> >>> On 8 May 2019, at 16:15, imeevma@tarantool.org wrote: >>> >>> This patch creates SQL functions CHARACTER_LENGTH() and >>> CHAR_LENGTH(). These functions work the same way. Each of them >>> takes only one argument of type TEXT and returns its length. >> >> I see your message in issue description: >> >> “ >> About this function, it was decided that it would be better to >> implement it as "{CHAR_LENGTH | CHARACTER_LENGTH} >> (character value expression)" (without "[USING CHARACTERS]”) >> “ >> >> Could you please provide explanation of this decision? > Since this issue is not of primary importance, after some > discussion it was decided that it would be too troublesome to > create these functions with the support of “[USING CHARACTERS]”. > >> What then is the difference between length() and char_length()? >> > I think the most noticeable difference is that the CHAR_LENGTH and > CHARACTER_LENGTH functions are described in ANSI, but LENGTH is > not. So the name is the only difference? Why don’t you use lengthFunc then as an implementation? I guess the main purpose of the ticket not to add just another one synonym, but follow ANSI syntax of function invocation including USING clause. >>> diff --git a/test/sql-tap/func3.test.lua b/test/sql-tap/func3.test.lua >>> index 6d6411c..a3a548b 100755 >>> --- a/test/sql-tap/func3.test.lua >>> +++ b/test/sql-tap/func3.test.lua >>> @@ -1,6 +1,6 @@ >>> #!/usr/bin/env tarantool >>> test = require("sqltester") >>> -test:plan(25) >>> +test:plan(37) >>> >>> --!./tcltestrunner.lua >>> -- 2010 August 27 >>> @@ -284,6 +284,134 @@ test:do_test( >>> return test:execsql "EXPLAIN SELECT likely(min(1.0+'2.0',4*11))" >>> end, test:execsql "EXPLAIN SELECT min(1.0+'2.0',4*11)”) >> >> Add test involving invalid utf8 characters. >> > Sorry, I could not understand what it means. Do you mean > something like this (not exactly invalid characters, but > still): > tarantool> box.execute("SELECT CHAR_LENGTH('\u{12345}');") > --- > - metadata: > - name: !!binary Q0hBUl9MRU5HVEgoJ/CSjYUnKQ== > type: integer > rows: > - [1] > ... > > I'm not sure if this should be added. > I added a test with utf8 characters. See sql-tap/badutf1.test.lua
next prev parent reply other threads:[~2019-06-06 18:55 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-05-08 13:15 [tarantool-patches] " imeevma 2019-05-21 12:58 ` [tarantool-patches] " n.pettik 2019-05-29 17:57 ` Mergen Imeev 2019-06-06 18:55 ` n.pettik [this message] 2019-06-15 14:45 ` Mergen Imeev 2019-06-25 21:40 ` n.pettik
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=FF90595F-F460-416F-9E2D-B533B97243BA@tarantool.org \ --to=korablev@tarantool.org \ --cc=imeevma@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='[tarantool-patches] Re: [PATCH v1 1/1] sql: create CHAR_LENGTH() and CHARACTER_LENGTH()' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox