From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id BE7F02A882 for ; Wed, 10 Oct 2018 08:22:13 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mcpLIWlE9HEo for ; Wed, 10 Oct 2018 08:22:13 -0400 (EDT) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 2BCA12A7D5 for ; Wed, 10 Oct 2018 08:22:13 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v1 1/1] sql: assertion in autoincrement column References: <8418885d-8812-d7d9-d74c-1808e2937153@tarantool.org> <87ed1a6c-aebb-ee8e-3621-b40d68ce428b@tarantool.org> From: Imeev Mergen Message-ID: <1ab0be5a-a790-1290-b646-6218a00dbb1c@tarantool.org> Date: Wed, 10 Oct 2018 15:22:10 +0300 MIME-Version: 1.0 In-Reply-To: <87ed1a6c-aebb-ee8e-3621-b40d68ce428b@tarantool.org> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: Vladislav Shpilevoy , tarantool-patches@freelists.org, "n.pettik" 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 >> 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 >>