Bug #112655 | In `json_{object|array}`, types of values are inconsistent with scalar function | ||
---|---|---|---|
Submitted: | 7 Oct 2023 8:00 | Modified: | 10 Oct 2023 7:33 |
Reporter: | Yang Keao | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: JSON | Severity: | S4 (Feature request) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[7 Oct 2023 8:00]
Yang Keao
[9 Oct 2023 10:40]
MySQL Verification Team
Hi Mr. Keao, Thank you for your bug report. We have managed to repeat it on both 8.0 and 8.1. However, 0 and 1 are actually aliases for false and true. Hence, this is not a bug, but it is a very nice feature request. Verified as a feature request.
[10 Oct 2023 7:33]
Knut Anders Hatlen
This looks like the same issue as the one reported in bug#79813. Closing as duplicate. Thanks.
[10 Oct 2023 7:46]
Roy Lyseng
The IF clause has an internal data type that is an integer, this is why an integer value is reported. In this case, it is possible to rewrite the IF clause from if (I_HAS_RECEIPT = 0, false, true) to (I_HAS_RECEIPT <> 0) which will give the desired boolean value.
[10 Oct 2023 9:41]
MySQL Verification Team
Hi Roy, Knut, Thank you for noticing that this is a duplicate.