1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-10-31 18:30:33 +03:00

MDEV-32854: Make JSON_DEPTH_LIMIT unlimited

This patch is the columnstore-part of the task. Columnstore wanted to have
previous 32 depth, so this patch aims at keeping the compatibility.
This commit is contained in:
Rucha Deodhar
2025-05-22 15:42:12 +05:30
committed by Leonid Fedorov
parent 9a2ebebaf9
commit 9fe37d5919
50 changed files with 1047 additions and 952 deletions

View File

@@ -17,7 +17,7 @@ using namespace funcexp::helpers;
namespace funcexp
{
CalpontSystemCatalog::ColType Func_json_contains_path::operationType(
FunctionParm& fp, CalpontSystemCatalog::ColType& /*resultType*/)
FunctionParm& fp, [[maybe_unused]] CalpontSystemCatalog::ColType& resultType)
{
return fp[0]->data()->resultType();
}
@@ -26,7 +26,7 @@ CalpontSystemCatalog::ColType Func_json_contains_path::operationType(
* getBoolVal API definition
*/
bool Func_json_contains_path::getBoolVal(Row& row, FunctionParm& fp, bool& isNull,
CalpontSystemCatalog::ColType& /*type*/)
[[maybe_unused]] CalpontSystemCatalog::ColType& type)
{
const auto& js_ns = fp[0]->data()->getStrVal(row, isNull);
if (isNull)
@@ -61,7 +61,6 @@ bool Func_json_contains_path::getBoolVal(Row& row, FunctionParm& fp, bool& isNul
isModeParsed = isModeConst;
}
initJSPaths(paths, fp, 2, 1);
if (paths.size() == 0)
hasFound.assign(argSize, false);
@@ -82,8 +81,6 @@ bool Func_json_contains_path::getBoolVal(Row& row, FunctionParm& fp, bool& isNul
}
}
json_engine_t jsEg;
json_path_t p;
json_get_path_start(&jsEg, getCharset(fp[0]), (const uchar*)js.data(), (const uchar*)js.data() + js.size(),
&p);
@@ -99,12 +96,20 @@ bool Func_json_contains_path::getBoolVal(Row& row, FunctionParm& fp, bool& isNul
while (json_get_path_next(&jsEg, &p) == 0)
{
#if MYSQL_VERSION_ID >= 100900
#if MYSQL_VERSION_ID >= 120200
json_path_step_t *last_step= reinterpret_cast<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, arrayCounters + (last_step - reinterpret_cast<json_path_step_t*>(p.steps.buffer))))
#else
if (hasNegPath && jsEg.value_type == JSON_VALUE_ARRAY &&
json_skip_array_and_count(&jsEg, arrayCounters + (p.last_step - p.steps)))
{
result = true;
break;
}
#endif
#endif
for (int restSize = argSize, curr = 0; restSize > 0; restSize--, curr++)