mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
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.
This commit is contained in:
@ -9664,8 +9664,9 @@ Item *negate_expression(THD *thd, Item *expr)
|
||||
{
|
||||
/* it is NOT(NOT( ... )) */
|
||||
Item *arg= ((Item_func *) expr)->arguments()[0];
|
||||
const Type_handler *fh= arg->fixed_type_handler();
|
||||
enum_parsing_place place= thd->lex->current_select->parsing_place;
|
||||
if (arg->is_bool_type() || place == IN_WHERE || place == IN_HAVING)
|
||||
if ((fh && fh->is_bool_type()) || place == IN_WHERE || place == IN_HAVING)
|
||||
return arg;
|
||||
/*
|
||||
if it is not boolean function then we have to emulate value of
|
||||
|
Reference in New Issue
Block a user