storage/innobase/fsp/fsp0fsp.cc:3108:58: error: conversion to ‘uint16_t {aka short unsigned int}’ from ‘unsigned int’ may alter its value [-Werror=conversion]
storage/innobase/handler/handler0alter.cc:10202:25: error: conversion to ‘unsigned char:7’ from ‘ulint {aka unsigned int}’ may alter its value [-Werror=conversion]
The idea is to have simple functions that the user can combine to produce
the exact result one wants, whether the user wants JSON object that has
common keys with another JSON object, or same key/value pair etc. So
making simpler function helps here.
We accomplish this by making three separate functions.
1) JSON_OBJECT_FILTER_KEYS(Obj, Arr_keys):
Put keys ( which are basically strings ) in hash, go over the object and
get key one by one. If the key is present in the hash,
add the key-value pair to result.
2) JSON_OBJECT_TO_ARRAY(Obj) : Create a string variable, Go over the json
object, and add each key value pair as an array into the result.
3) JSON_ARRAY_INTERSECT(arr1, arr2) :
Go over one of the json and add each item of the array
in hash (after normalizing each item). Go over the second array,
search the normalized item one by one in the hash. If item is found,
add it to the result.
1fb4871...
by
Rucha Deodhar <email address hidden>
MDEV-30145: JSON_TABLE: allow to retrieve the key when iterating on JSON
objects
Idea behind implementation:
We get the json object specified by the json path. Then, transform it into
key-value pairs by going over the json. Get each key-value pair
one-by-one and return the result.