Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Imeev Mergen <imeevma@tarantool.org>, tarantool-patches@freelists.org
Cc: kostja@tarantool.org
Subject: [tarantool-patches] Re: [PATCH v1 1/1] sql: assertion in autoincrement column
Date: Wed, 10 Oct 2018 13:21:53 +0300	[thread overview]
Message-ID: <87ed1a6c-aebb-ee8e-3621-b40d68ce428b@tarantool.org> (raw)
In-Reply-To: <a1c83bf3-42a4-90f3-3e6e-a509c01cc20a@tarantool.org>

Hi! Thanks for the fixes! See 3 comments below.

>> 3. Why mismatch? integer * integer * integer is still an
>> integer. If it is an overflow, then it should print 'overflow',
>> it is not? An overflow should be detected somewhere.
> Now it is works the same way it works with columns without
> autoincrement:
> create table t4 (s1 int primary key);
> insert into t4 values (2147483647);
> insert into t4 select max(s1)*max(s1)*max(s1) from t4;
> 
> Also, result of query
> select max(s1)*max(s1)*max(s1) from t4
> is a real number:
> 9.903520300448e+27

1. The thing you said does not correlate with my
question. Why mismatch? I multiplied integer three
times, it should not auto turn into double then. It
should throw 'overflow' error.

> New patch:
> commit 53a229c67b096a09f26df4b5ba73d9a90c46e38f
> Author: Mergen Imeev <imeevma@gmail.com>
> Date:   Thu Sep 27 22:42:29 2018 +0300
> 
>      sql: assertion in autoincrement column
> 
>      If query is like "INSERT INTO table SELECT ..." then it is
>      completely fine that the result of SELECT isn't integer. This
>      value wasn't cheched propertly if it was inserted in column
>      with autoincrement.

2. As you said above, it is not about autoincrement. Why in the
commit message do you say on the contrary?

3. It is not linked with "insert into table select". This fails
as well:

box.sql.execute("CREATE TABLE t0 (s1 INT PRIMARY KEY)")
box.sql.execute("INSERT INTO t0 VALUES (2147483647*2147483647*2147483647)")

> 
>      Closes #3670
> 

  reply	other threads:[~2018-10-10 10:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-28 16:14 [tarantool-patches] " imeevma
2018-09-29  4:27 ` [tarantool-patches] " Konstantin Osipov
2018-10-05 16:41   ` Imeev Mergen
2018-10-05 16:45     ` Imeev Mergen
     [not found]     ` <665AF75C-4542-4DE1-BFCA-F480367585A6@gmail.com>
2018-10-11 16:22       ` Imeev Mergen
2018-10-11 16:38         ` n.pettik
2018-10-03 15:19 ` Vladislav Shpilevoy
2018-10-05 16:40   ` Imeev Mergen
2018-10-10 10:21     ` Vladislav Shpilevoy [this message]
2018-10-10 12:22       ` Imeev Mergen
2018-11-01 14:40 ` Kirill Yukhin

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=87ed1a6c-aebb-ee8e-3621-b40d68ce428b@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=imeevma@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v1 1/1] sql: assertion in autoincrement column' \
    /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