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
- causes
-
MDEV-41402 Server crashes in Item_field::used_tables/find_producing_item on condition pushdown into UNION derived table
-
- Approved
-
-
MDEV-41404 Server crashes in Item_field::used_tables/Item_window_func::update_used_tables
-
- Approved
-
-
MDEV-41418 Null MEMBER OF (json) depends on type
-
- Stalled
-
-
MDEV-41419 Nested containment wrongly counts as membership (MEMBER OF ..))
-
- Confirmed
-
-
MDEV-41420 "MEMBER" was not a keyword, while now using it as alias returns error
-
- Open
-
-
MDEV-41421 Error message names json_contains instead of member function
-
- Approved
-
-
MDEV-41563 JSON_QUOTE() and MEMBER OF mishandle ZEROFILL numeric columns
-
- Approved
-
-
MDEV-41586 JSON_QUOTE emits utf8mb4, JSON_CONTAINS compares raw bytes
-
- Open
-
- includes
-
MDEV-13645 JSON_QUOTE() - return NULL on numbers
-
- Open
-
- is part of
-
MDEV-17397 Implement JSON functions available in MySQL 8.0 but not MariaDB
-
- Open
-
-
MDEV-28906 MySQL 8.0 desired compatibility
-
- Open
-
- relates to
-
MDEV-38740 Implement a distinct data type for JSON
-
- In Testing
-
-
MDEV-40168 Indexes over JSON data based on Fulltext index
-
- Stalled
-
-
MDEV-38306 Optimizer support for Multi-Valued indexes over JSON data
-
- Open
-
- has action item
-
DOCS-6518 Loading...