From: imeevma@tarantool.org
To: v.shpilevoy@tarantool.org, tsafin@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH v2 02/10] sql: fix functions return types
Date: Fri, 14 Aug 2020 18:04:55 +0300 [thread overview]
Message-ID: <804a579f9ba60138c0bf579da4c6a3c253d2c272.1597417321.git.imeevma@gmail.com> (raw)
In-Reply-To: <cover.1597417321.git.imeevma@gmail.com>
This patch fixes incorrect return types in SQL built-in function definitions.
---
src/box/sql/func.c | 10 +++++-----
test/sql/types.result | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/box/sql/func.c b/src/box/sql/func.c
index 487cdafe1..affb285aa 100644
--- a/src/box/sql/func.c
+++ b/src/box/sql/func.c
@@ -2466,7 +2466,7 @@ static struct {
}, {
.name = "IFNULL",
.param_count = 2,
- .returns = FIELD_TYPE_INTEGER,
+ .returns = FIELD_TYPE_SCALAR,
.aggregate = FUNC_AGGREGATE_NONE,
.is_deterministic = true,
.flags = SQL_FUNC_COALESCE,
@@ -2516,7 +2516,7 @@ static struct {
}, {
.name = "LIKE",
.param_count = -1,
- .returns = FIELD_TYPE_INTEGER,
+ .returns = FIELD_TYPE_BOOLEAN,
.aggregate = FUNC_AGGREGATE_NONE,
.is_deterministic = true,
.flags = SQL_FUNC_NEEDCOLL | SQL_FUNC_LIKE,
@@ -2526,7 +2526,7 @@ static struct {
}, {
.name = "LIKELIHOOD",
.param_count = 2,
- .returns = FIELD_TYPE_BOOLEAN,
+ .returns = FIELD_TYPE_SCALAR,
.aggregate = FUNC_AGGREGATE_NONE,
.is_deterministic = true,
.flags = SQL_FUNC_UNLIKELY,
@@ -2536,7 +2536,7 @@ static struct {
}, {
.name = "LIKELY",
.param_count = 1,
- .returns = FIELD_TYPE_BOOLEAN,
+ .returns = FIELD_TYPE_SCALAR,
.aggregate = FUNC_AGGREGATE_NONE,
.is_deterministic = true,
.flags = SQL_FUNC_UNLIKELY,
@@ -2686,7 +2686,7 @@ static struct {
}, {
.name = "ROUND",
.param_count = -1,
- .returns = FIELD_TYPE_INTEGER,
+ .returns = FIELD_TYPE_DOUBLE,
.aggregate = FUNC_AGGREGATE_NONE,
.is_deterministic = true,
.flags = 0,
diff --git a/test/sql/types.result b/test/sql/types.result
index 95f7713e8..2498f3a48 100644
--- a/test/sql/types.result
+++ b/test/sql/types.result
@@ -231,7 +231,7 @@ box.execute("SELECT s LIKE NULL FROM t1;")
---
- metadata:
- name: COLUMN_1
- type: integer
+ type: boolean
rows:
- [null]
...
@@ -257,7 +257,7 @@ box.execute("SELECT NULL LIKE s FROM t1;")
---
- metadata:
- name: COLUMN_1
- type: integer
+ type: boolean
rows:
- [null]
...
--
2.25.1
next prev parent reply other threads:[~2020-08-14 15:04 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-14 15:04 [Tarantool-patches] [PATCH v2 00/10] sql: properly check arguments types of built-in functions imeevma
2020-08-14 15:04 ` [Tarantool-patches] [PATCH v2 01/10] sql: do not return UNSIGNED in " imeevma
2020-08-22 14:23 ` Vladislav Shpilevoy
2020-08-14 15:04 ` imeevma [this message]
2020-08-22 14:24 ` [Tarantool-patches] [PATCH v2 02/10] sql: fix functions return types Vladislav Shpilevoy
2020-08-14 15:04 ` [Tarantool-patches] [PATCH v2 03/10] sql: change signature of trim() imeevma
2020-08-22 14:26 ` Vladislav Shpilevoy
2020-08-14 15:04 ` [Tarantool-patches] [PATCH v2 04/10] box: add new options for functions imeevma
2020-08-22 14:28 ` Vladislav Shpilevoy
2020-08-14 15:05 ` [Tarantool-patches] [PATCH v2 05/10] sql: use has_vararg for built-in functions imeevma
2020-08-14 15:05 ` [Tarantool-patches] [PATCH v2 06/10] sql: add overloaded versions of the functions imeevma
2020-08-22 14:29 ` Vladislav Shpilevoy
2020-08-14 15:05 ` [Tarantool-patches] [PATCH v2 07/10] sql: move built-in function definitions in _func imeevma
2020-08-22 14:30 ` Vladislav Shpilevoy
2020-08-14 15:05 ` [Tarantool-patches] [PATCH v2 08/10] box: add param_list to 'struct func' imeevma
2020-08-22 14:30 ` Vladislav Shpilevoy
2020-08-14 15:05 ` [Tarantool-patches] [PATCH v2 09/10] sql: check built-in functions argument types imeevma
2020-08-14 15:05 ` [Tarantool-patches] [PATCH v2 10/10] sql: refactor sql/func.c imeevma
2020-08-22 14:31 ` Vladislav Shpilevoy
2020-08-22 14:25 ` [Tarantool-patches] [PATCH v2 00/10] sql: properly check arguments types of built-in functions Vladislav Shpilevoy
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=804a579f9ba60138c0bf579da4c6a3c253d2c272.1597417321.git.imeevma@gmail.com \
--to=imeevma@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--cc=tsafin@tarantool.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH v2 02/10] sql: fix functions return types' \
/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