Details
-
New Feature
-
Status: In Review (View Workflow)
-
Critical
-
Resolution: Unresolved
Description
Implement MEMBER OF operator for MySQL compatibility.
Used as
mysql> SELECT 17 MEMBER OF('[23, "abc", 17, "ab", 10]'); |
+-------------------------------------------+ |
| 17 MEMBER OF('[23, "abc", 17, "ab", 10]') | |
+-------------------------------------------+ |
| 1 |
|
+-------------------------------------------+ |
 |
mysql> SELECT "17" MEMBER OF('[23, "abc", 17, "ab", 10]'); |
+---------------------------------------------+ |
| "17" MEMBER OF('[23, "abc", 17, "ab", 10]') | |
+---------------------------------------------+ |
| 0 |
|
+---------------------------------------------+ |
Can probably be implemented as
SELECT JSON_CONTAINS(arg2, JSON_QUOTE(arg1)); |
but JSON_QUOTE needs to be extended to convert non-string arguments. Now it's
MariaDB [test]> select json_quote(17), json_quote('17'), json_quote(null); |
+----------------+------------------+------------------+ |
| json_quote(17) | json_quote('17') | json_quote(null) | |
+----------------+------------------+------------------+ |
| NULL | "17" | NULL | |
+----------------+------------------+------------------+ |
1 row in set (0.001 sec) |
must be
MariaDB [test]> select json_quote(17), json_quote('17'), json_quote(null); |
+----------------+------------------+------------------+ |
| json_quote(17) | json_quote('17') | json_quote(null) | |
+----------------+------------------+------------------+ |
| 17 | "17" | null | |
+----------------+------------------+------------------+ |
1 row in set (0.001 sec) |
that is, numbers and null should be converted to json numbers and json null.
Attachments
Issue Links
- is part of
-
MDEV-28906 MySQL 8.0 desired compatibility
-
- Open
-
- relates to
-
MDEV-40168 Indexes over JSON data based on Fulltext index
-
- In Progress
-
-
MDEV-38306 Optimizer support for Multi-Valued indexes over JSON data
-
- Open
-
- has action item
-
DOCS-6518 Loading...