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 457C724E4F for ; Fri, 23 Aug 2019 11:02:15 -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 P5SZvWxhiN1r for ; Fri, 23 Aug 2019 11:02:15 -0400 (EDT) Received: from smtp21.mail.ru (smtp21.mail.ru [94.100.179.250]) (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 04B7624DEA for ; Fri, 23 Aug 2019 11:02:14 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v4 4/4] sql: support user-defined functions in SQL References: <9c29f1d8dfe7ab9b644a7e05bf5f47ccdd90e4a6.1566400979.git.kshcherbatov@tarantool.org> <372F3EA5-1F1A-40D5-A285-C334B47EA9EA@tarantool.org> From: Kirill Shcherbatov Message-ID: <7617f12c-ecb5-dc90-a1ad-0d2f47cd95ee@tarantool.org> Date: Fri, 23 Aug 2019 18:02:13 +0300 MIME-Version: 1.0 In-Reply-To: <372F3EA5-1F1A-40D5-A285-C334B47EA9EA@tarantool.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit 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, "n.pettik" >> +/* Opcode: Function P1 P2 P3 P4 P5 > > Nit: P1 is unused. As a rule we spot unused arguments with stars (*). > And I’d swap P1 and P5, i.e. pass range of registers in P1-P2, > save result to P3 I've replaced P1 definition with a star sign. However, I don't like your second proposal. The OP_Function has this interface to be basically-compatible with legacy OP_BuiltinFunction opcode. Thus it is possible to care only about opcode generation don't thinking about arguments order: + int op = func->def->language == + FUNC_LANGUAGE_SQL_BUILTIN ? + OP_BuiltinFunction0 : OP_Function; sqlVdbeAddOp4(v, op, constMask, r1, target,