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 9EC892C96E for ; Thu, 25 Apr 2019 06:52:40 -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 xR4A7nTwdnDW for ; Thu, 25 Apr 2019 06:52:40 -0400 (EDT) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 4E56225CCC for ; Thu, 25 Apr 2019 06:52:40 -0400 (EDT) Received: by mail-lj1-f194.google.com with SMTP id p14so19813538ljg.5 for ; Thu, 25 Apr 2019 03:52:40 -0700 (PDT) Date: Thu, 25 Apr 2019 13:52:37 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH v1 1/1] sql: invalid integer type in arithmetic operations Message-ID: <20190425105237.GA2297@atlas> References: <72941eba60647c98f4559cbd0c862bade990d761.1556120090.git.kshcherbatov@tarantool.org> <0929e575-2d28-7cd0-36bc-0a1bf1af76fe@tarantool.org> <04E0C86F-84E5-400F-ACE0-80FD6799E4E3@tarantool.org> <20190425104956.GI29257@atlas> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190425104956.GI29257@atlas> 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: tarantool-patches@freelists.org Cc: Vladislav Shpilevoy , Kirill Shcherbatov * Konstantin Osipov [19/04/25 13:49]: > * n.pettik [19/04/25 09:18]: > > Surely, we still can create space and set format with unsigned types > > from Lua, so strictly speaking UNSIGNED is allowed even now. > > But we can’t set UNSIGNED as a type of column in SQL, and we don’t > > set this type in meta. So in some sense it is not allowed. > > Mb it is worth fixing comment. Or return _UNSIGNED instead > > of _NUMBER in this case. I guess there will be no severe consequences. > > SQL *is* server. Please begin by having a comment containing a > table for integer type arithmetics, something like this: > > Plus operation: > -------------- > > integer float > > integer integer float > float float float > > It's best to implement such table in the source code too, and not > have complicated branching. Re UNSIGNED type itself: once you have a proper table for type arithmetics, it will be easy to understand what the result of unsigned + unsigned should be. Most likely it should be unsigned, not a number. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov