1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-05 16:15:50 +03:00

Merge branch 'stable-23.10' into json_depth-rucha

This commit is contained in:
Rucha Deodhar
2025-06-03 16:29:29 +05:30
committed by GitHub
200 changed files with 2722 additions and 20812 deletions

View File

@@ -31,7 +31,7 @@ int Func_json_extract::doExtract(Row& row, FunctionParm& fp, json_value_types* t
bool mayMulVal;
int wildcards;
bool isMatch;
#ifdef MYSQL_GE_1009
#if MYSQL_VERSION_ID >= 100900
int arrayCounter[JSON_DEPTH_LIMIT];
bool hasNegPath = false;
#endif
@@ -62,12 +62,12 @@ int Func_json_extract::doExtract(Row& row, FunctionParm& fp, json_value_types* t
if (!path.parsed && parseJSPath(path, row, fp[i]))
return 1;
#ifdef MYSQL_GE_1009
#if MYSQL_VERSION_ID >= 100900
hasNegPath |= path.p.types_used & JSON_PATH_NEGATIVE_INDEX;
#endif
}
#ifdef MYSQL_GE_1009
#if MYSQL_VERSION_ID >= 100900
wildcards = (JSON_PATH_WILD | JSON_PATH_DOUBLE_WILD | JSON_PATH_ARRAY_RANGE);
#else
wildcards = (JSON_PATH_WILD | JSON_PATH_DOUBLE_WILD);
@@ -87,14 +87,13 @@ int Func_json_extract::doExtract(Row& row, FunctionParm& fp, json_value_types* t
while (json_get_path_next(&jsEg, &p) == 0)
{
#ifdef MYSQL_GE_1009
json_path_step_t *last_step= (json_path_step_t*)(mem_root_dynamic_array_get_val(&p.steps, p.last_step_idx));
if (hasNegPath && jsEg.value_type == JSON_VALUE_ARRAY &&
json_skip_array_and_count(&jsEg, arrayCounter + (last_step - (json_path_step_t*)(p.steps.buffer))))
return 1;
#endif
#ifdef MYSQL_GE_1009
#if MYSQL_VERSION_ID >= 100900
isMatch = matchJSPath(paths, &p, jsEg.value_type, arrayCounter, false);
#else
isMatch = matchJSPath(paths, &p, jsEg.value_type, nullptr, false);