[tarantool-patches] Re: [PATCH v4 4/4] sql: support user-defined functions in SQL

Kirill Shcherbatov kshcherbatov at tarantool.org
Fri Aug 23 18:02:13 MSK 2019


>> +/* 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,




More information about the Tarantool-patches mailing list