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 924C124E40 for ; Tue, 13 Aug 2019 04:32:39 -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 d5eDlKVDvRzJ for ; Tue, 13 Aug 2019 04:32:39 -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 DF8CE24D94 for ; Tue, 13 Aug 2019 04:32:38 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v2 5/8] sql: introduce a signature_mask for functions References: <6f6689986b1dd79adc478c5da9f1d458da42d483.1565275469.git.kshcherbatov@tarantool.org> <20190812220427.GS32337@atlas> From: Kirill Shcherbatov Message-ID: <8e019e9c-0845-d8c9-a1a7-ce8b7047b0ef@tarantool.org> Date: Tue, 13 Aug 2019 11:32:36 +0300 MIME-Version: 1.0 In-Reply-To: <20190812220427.GS32337@atlas> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: Konstantin Osipov , Tarantool MailList Cc: Nikita Pettik > + * The count of arguments for function is limited with >> + * (CHAR_BITS*sizeof(uint64_t) - 1). When the highest bit >> + * of the mask is set, this means that greater values >> + * are supported. E.g. greatest function works correctly >> + * with any number of input arguments. >> + */ >> + uint64_t signature_mask; > > Good idea, but why make the mask sooo big?-))) > I don't think we have more than 3 arguments in any overloaded > function? 63 arguments is not too much for UDF (this would use for UDF too), I guess. Moreover, column_mask API is worked with 64bit bitmasks. > >> + if (!column_mask_fieldno_is_set(p->signature_mask, (uint32_t)nArg)) >> return 0; > > Are you sure you want to use column mask api just to test a bit? It is convenient, because column_mask is "smart" and it also return true for fieldno > 64: this is ok for uniform scalar functions like GREATEST(1,.......)