Bug #90833 | NULLIF returns boolean in context of JSON_ARRAYAGG and JSON_OBJECTAGG's value | ||
---|---|---|---|
Submitted: | 11 May 2018 10:43 | Modified: | 12 Jul 2018 12:40 |
Reporter: | Markus Winand | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: JSON | Severity: | S3 (Non-critical) |
Version: | 8.0.11 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[11 May 2018 10:43]
Markus Winand
[11 May 2018 11:35]
MySQL Verification Team
Thank you for the bug report.
[15 May 2018 7:03]
Catalin Besleaga
Documentation says: NULLIF(expr1,expr2) Returns NULL if expr1 = expr2 is true, otherwise returns expr1. This is the same as CASE WHEN expr1 = expr2 THEN NULL ELSE expr1 END. The return value has the same type as the first argument. but the return type is bool since Item_func_nullif inherits from Item_bool_func2 which is wrong. So the problem is with NULLIF not with the json functions.
[12 Jul 2018 12:40]
Jon Stephens
Documented fix as follows in the MySQL 8.0.13 changelog: In some contexts, the NULLIF() function returned its first argument as a boolean value rather than its actual type. This was noticed when the result of this function was used as an argument to JSON_ARRAYAGG() or JSON_OBJECTAGG(), but could have occurred in other such cases. Closed.