From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 660A8445320 for ; Wed, 29 Jul 2020 12:34:53 +0300 (MSK) Date: Wed, 29 Jul 2020 12:34:50 +0300 From: Mergen Imeev Message-ID: <20200729093450.GA14590@tarantool.org> References: <20200727122429.GA49280@tarantool.org> <018701d66585$d4c081d0$7e418570$@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <018701d66585$d4c081d0$7e418570$@tarantool.org> Subject: Re: [Tarantool-discussions] The result type and argument types of the built-in SQL functions. List-Id: Tarantool development process List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Timur Safin Cc: tarantool-discussions@dev.tarantool.org On Wed, Jul 29, 2020 at 11:54:12AM +0300, Timur Safin wrote: > > I general, I agree that UNSIGNED is unnecessary, but the rest of table > is pretty much ok with me. (Though blob vs string discussion opened elsewhere > is important) > > With one small note below... > > : From: Mergen Imeev > : Subject: The result type and argument types of the built-in SQL functions. > : > : Hi, Peter! > : > : I would like to ask you a few questions about the result type and argument > : types of the SQL built-in functions. > : > : I suggest changing the result types of some functions. A table with the > : current > : result type and the suggested result type is below. > : > : FUNCTION NAME CURRENT SUGGESTED > : abs number number > : avg number double > : char string string > : character_length integer unsigned > ... > : soundex string string > : substr string string > : sum number number > : total number double > > Why total should be different than sum? (I'd use the same number) > In SQLite TOTAL always returns DOUBLE. SUM may return INTEGER if all values are of INTEGER type. > > Regards, > Timur >