summaryrefslogtreecommitdiff
path: root/sql/item_jsonfunc.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-05-31 18:52:32 +0400
committerAlexander Barkov <bar@mariadb.com>2018-05-31 18:52:32 +0400
commitffe83e8e7bef32eb2a80aad2d382f0b023dd3a44 (patch)
tree065bfa8c2afb2dcb2096e40d18c2e56a61eae47f /sql/item_jsonfunc.cc
parent3ceb4a54a178d3e92529b4be16e866e18fd15218 (diff)
downloadmariadb-git-ffe83e8e7bef32eb2a80aad2d382f0b023dd3a44.tar.gz
MDEV-16351 JSON_OBJECT() treats hybrid functions with boolean arguments as numbers
Now the boolean data type is preserved in hybrid functions and MIN/MAX, so COALESCE(bool_expr,bool_expr) and MAX(bool_expr) are correctly detected by JSON_OBJECT() as being boolean rather than numeric expressions.
Diffstat (limited to 'sql/item_jsonfunc.cc')
-rw-r--r--sql/item_jsonfunc.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc
index 4b2de7cf28b..be1d84982de 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -1397,7 +1397,7 @@ null_return:
static int append_json_value(String *str, Item *item, String *tmp_val)
{
- if (item->is_bool_type())
+ if (item->type_handler()->is_bool_type())
{
longlong v_int= item->val_int();
const char *t_f;