Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: "n.pettik" <korablev@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH] sql: fix type in meta for unsigned binding
Date: Wed, 24 Jul 2019 21:23:07 +0300	[thread overview]
Message-ID: <20190724182307.GF4764@atlas> (raw)
In-Reply-To: <2D87D431-5106-4599-8AB9-ABFD66B99EA2@tarantool.org>

* n.pettik <korablev@tarantool.org> [19/07/24 20:45]:
> 
> 
> > On 24 Jul 2019, at 20:10, Konstantin Osipov <kostja@tarantool.org> wrote:
> > 
> > * Nikita Pettik <korablev@tarantool.org> [19/07/24 19:59]:
> >> It was decided that for all integer literals we would return "INTEGER"
> >> type, not "UNSIGNED". Accidentally, after substitution of unsigned
> >> binding value type was set to "UNSIGNED". Let's fix that and set
> >> "INTEGER" type.
> > 
> > the patch is lgtm but I'm not sure it covers all cases.
> > 
> > I've seen a lot of unsigned inthe tests.
> 
> I see only one more unsigned appearance:
> 
> box.execute("SELECT CAST('123' AS UNSIGNED);")
> ---
> - metadata:
>   - name: CAST('123' AS UNSIGNED)
>     type: unsigned
>   rows:
>   - [123]
> …
> 
> But I guess in this case user would be less surprised
> if one saw unsigned type than integer.

This cast is very good. Very, very, good :) This cast is even better:

tarantool> select cast(NULL as unsigned)
{
  metadata = {
    {
      name = "cast(NULL as unsigned)",
      type = "unsigned"
    }
  },
  rows = {
    "[null]"
  }
}

This cast is what static types were all about. Not about a
separate compile-time pass with static analysis - it's an
implementation detail, and I'm not sure we'll ever need it,
it is merely a performance optimization. 

-- 
Konstantin Osipov, Moscow, Russia

      reply	other threads:[~2019-07-24 18:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24 16:55 [tarantool-patches] " Nikita Pettik
2019-07-24 17:10 ` [tarantool-patches] " Konstantin Osipov
2019-07-24 17:44   ` n.pettik
2019-07-24 18:23     ` Konstantin Osipov [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=20190724182307.GF4764@atlas \
    --to=kostja@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH] sql: fix type in meta for unsigned binding' \
    /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