Tarantool development patches archive
 help / color / mirror / Atom feed
From: Nikita Pettik <korablev@tarantool.org>
To: imeevma@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v3 1/2] sql: fix CAST() from STRING to INTEGER
Date: Wed, 25 Mar 2020 18:10:58 +0000	[thread overview]
Message-ID: <20200325181058.GC2116@tarantool.org> (raw)
In-Reply-To: <8f687a7553ab76d61eb125631bba4655f10b919e.1585135623.git.imeevma@gmail.com>

On 25 Mar 14:38, imeevma@tarantool.org wrote:
> Prior to this patch, STRING, which contains the DOUBLE value,
> could be cast to INTEGER. This was done by converting STRING to
> DOUBLE and then converting this DOUBLE value to INTEGER. This may
> affect the accuracy of CAST(), so it was forbidden.
> 
> Before patch:
> tarantool> box.execute("SELECT CAST('1.1' as INTEGER);")
> ---
> - metadata:
>   - name: CAST('1.1' as INTEGER)
>     type: integer
>   rows:
>   - [1]
> ...
> 
> After patch:
> tarantool> box.execute("SELECT CAST('1.1' as INTEGER);")
> ---
> - null
> - 'Type mismatch: can not convert 1.1 to integer'
> ...

What about CAST('1.0' AS INTEGER)? Should this conversion be banned?
Moreover, your patch affects not only explicit cast. Please, split
it into two commits.

Doc. request is missing.

  reply	other threads:[~2020-03-25 18:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 11:38 [Tarantool-patches] [PATCH v3 0/2] sql: fix CAST() from BLOB " imeevma
2020-03-25 11:38 ` [Tarantool-patches] [PATCH v3 1/2] sql: fix CAST() from STRING " imeevma
2020-03-25 18:10   ` Nikita Pettik [this message]
2020-03-25 11:38 ` [Tarantool-patches] [PATCH v3 2/2] sql: add '\0' to the BLOB when it is cast " imeevma
2020-03-25 18:17   ` Nikita Pettik
2020-03-25 17:46 ` [Tarantool-patches] [PATCH v3 0/2] sql: fix CAST() from BLOB " Nikita Pettik
2020-03-27 11:30   ` Mergen Imeev

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=20200325181058.GC2116@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=imeevma@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v3 1/2] sql: fix CAST() from STRING to INTEGER' \
    /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