Tarantool development patches archive
 help / color / mirror / Atom feed
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: Wed, 26 Jun 2019 00:40:35 +0300	[thread overview]
Message-ID: <2501E75F-D71B-4C4F-8CA0-7F102A9B9389@tarantool.org> (raw)
In-Reply-To: <20190615144551.GA31739@tarantool.org>

[-- Attachment #1: Type: text/plain, Size: 1890 bytes --]


> First patch:
> 
> From 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:
> 
> From 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 = 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().
> +—

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


[-- Attachment #2: Type: text/html, Size: 35167 bytes --]

      reply	other threads:[~2019-06-25 21:40 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
2019-06-15 14:45       ` Mergen Imeev
2019-06-25 21:40         ` n.pettik [this message]

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=2501E75F-D71B-4C4F-8CA0-7F102A9B9389@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