Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2.5
-
Debian
Description
There seems to be different behaviour when comparing the result of JSON_EXTRACT in MySql 5.7 and Mariadb 10.2.5.
In MySql the following query will result in true, but in mariadb this results in 0.
select JSON_EXTRACT('{"name":"value"}', '$.name') = 'value'; |
To fix this I tried to just quote the value to compare and it works in mariadb (result: 1) but not in MySql (result: 0).
select JSON_EXTRACT('{"name":"value"}', '$.name') = JSON_QUOTE('value'); |
It's also an issue with boolean values:
SET @str = '{\"asdf\":true}'; |
SET @path = "$.\"asdf\""; |
select @str, @path, JSON_EXTRACT(@str, @path) = 'true'; -- mariadb |
select @str, @path, JSON_EXTRACT(@str, @path) = true; -- mysql |