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 252072535B for ; Tue, 2 Apr 2019 03:54:06 -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 pG64TjrozwUS for ; Tue, 2 Apr 2019 03:54:06 -0400 (EDT) Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (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 D159B20081 for ; Tue, 2 Apr 2019 03:54:05 -0400 (EDT) Date: Tue, 2 Apr 2019 10:54:03 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 07/13] sql: arithmetic functions support big integers Message-ID: <20190402075403.GG25072@chai> References: <071a569b-de79-1afe-7335-44de04d6a867@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <071a569b-de79-1afe-7335-44de04d6a867@tarantool.org> 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: "n.pettik" * Stanislav Zudin [19/04/01 23:44]: > > What is more, personally I would apply the same fix as for atoi functions: > > make them return -1 in case of overflow or division by 0 and set > > diag message right in these functions; use enum to represent their args. > > It's a bad practice to write diagnostic from the low-level functions. > Using a single enum as a return value gives a compact readable code. I'd agree with this if I knew there could be some context where we would use these functions without needing to set the diagnostics area. I can not imagine such a case. So I'd make things simple right now and assume it's a simple to-do refactoring should we need it in the future. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov