Tarantool development patches archive
 help / color / mirror / Atom feed
From: Imeev Mergen <imeevma@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
	tarantool-patches@freelists.org,
	"n.pettik" <korablev@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v1 1/1] sql: assertion in autoincrement column
Date: Wed, 10 Oct 2018 15:22:10 +0300	[thread overview]
Message-ID: <1ab0be5a-a790-1290-b646-6218a00dbb1c@tarantool.org> (raw)
In-Reply-To: <87ed1a6c-aebb-ee8e-3621-b40d68ce428b@tarantool.org>

Hello! Thank you for review! After discussion it was decided to
left patch as it is and create new ticket about changing types
after SELECT.

Nikita, can you review this patch?

On 10/10/2018 01:21 PM, Vladislav Shpilevoy wrote:
> 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 12:22 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
2018-10-10 12:22       ` Imeev Mergen [this message]
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=1ab0be5a-a790-1290-b646-6218a00dbb1c@tarantool.org \
    --to=imeevma@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.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