From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp29.i.mail.ru (smtp29.i.mail.ru [94.100.177.89]) (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 C3107445320 for ; Thu, 16 Jul 2020 19:21:12 +0300 (MSK) Date: Thu, 16 Jul 2020 16:21:11 +0000 From: Nikita Pettik Message-ID: <20200716162111.GB433@tarantool.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH v6 04/22] sql: check args of avg(), sum() and total() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: imeevma@tarantool.org Cc: tarantool-patches@dev.tarantool.org On 16 Jul 17:45, imeevma@tarantool.org wrote: > After this patch, the argument types of the avg(), sum() and total() > functions will be checked properly. > > Part of #4159 > --- > src/box/sql/func.c | 18 ++--- > test/sql-tap/func.test.lua | 8 +- > test/sql-tap/func5.test.lua | 149 +++++++++++++++++++++++++++++++++++- > 3 files changed, 157 insertions(+), 18 deletions(-) > > + > +test:do_catchsql_test( > + "func-5-6.4.7", [[ > + SELECT total("_auto_field_") from (values (X'3334'), (X'3334'), (X'3334')); > + ]], { > + 1, "Type mismatch: can not convert varbinary to number" > + }) > Why don't you use arguemnts of different types? Like numb+numb+bool? + > test:finish_test() > -- > 2.25.1 >