From: Nikita Pettik <korablev@tarantool.org> To: Konstantin Osipov <kostja@scylladb.com> Cc: tarantool-patches@freelists.org, kyukhin@tarantool.org Subject: [tarantool-patches] Re: [PATCH] sql: make GREATEST/LEAST built-ins accept at least two args Date: Thu, 29 Aug 2019 16:27:53 +0300 [thread overview] Message-ID: <20190829132749.GA52325@tarantool.org> (raw) In-Reply-To: <20190829103847.GF22684@atlas> On Thu, Aug 29, 2019 at 01:38:47PM +0300, Konstantin Osipov wrote: > * Nikita Pettik <korablev@tarantool.org> [19/08/28 17:58]: > > Before a46b52004 SQL implementation featured min()/max() functions > > overloading: if one argument was passed, then aggregate version would be > > invoked; otherwise - scalar one. We decided to get rid of it and rename > > scalar version to LEAST()/GREATEST() correspondingly. However, assertion > > inside their implementations has been remained: it verifies that number > > of passed arguments is greater than 1. On the other hand, now one can > > pass literally any number of arguments to this function, including one > > (which results in fired mentioned assertion) and zero (which leads to > > NULL dereference in expr.c: these functions are marked with > > SQL_FUNC_NEEDCOLL flag, and as a consequence they are assumed to have at > > least one argument). Firstly, let's place check that number of passed > > arguments more than one. Secondly, let's not assume that functions with > > SQL_FUNC_NEEDCOLL must have any arguments. > > > > Closes #4453 > > If you introduce a new error message, why are you using it in one > place only? It is also used in Kirill's branch where he reworks built-ins. I've aksed him to cherry-pick my commit. See: https://github.com/tarantool/tarantool/commit/f8927cf3d411c88235cf532cfa3d94ee048969f2 > -- > Konstantin Osipov, Moscow, Russia
prev parent reply other threads:[~2019-08-29 13:27 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-08-28 14:55 [tarantool-patches] " Nikita Pettik [not found] ` <20190829103847.GF22684@atlas> 2019-08-29 13:27 ` Nikita Pettik [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190829132749.GA52325@tarantool.org \ --to=korablev@tarantool.org \ --cc=kostja@scylladb.com \ --cc=kyukhin@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='[tarantool-patches] Re: [PATCH] sql: make GREATEST/LEAST built-ins accept at least two args' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox