[cp]:sync multivalue bugfix from 431 to master

This commit is contained in:
obdev
2024-06-20 09:26:27 +00:00
committed by ob-robot
parent bf47be7c3a
commit edfad6976f
37 changed files with 873 additions and 215 deletions

View File

@ -1850,6 +1850,39 @@ int ObSqlParameterization::mark_tree(ParseNode *tree ,SqlInfo &sql_info)
sql_info.ps_need_parameterized_ = false;
} else if ((0 == func_name.case_compare("json_extract"))) {
sql_info.ps_need_parameterized_ = false;
for (int64_t i = 1; OB_SUCC(ret) && i < tree->num_child_; i++) {
if (OB_ISNULL(tree->children_[i])) {
ret = OB_INVALID_ARGUMENT;
SQL_PC_LOG(WARN, "invalid argument", K(ret), K(tree->children_[i]));
} else {
tree->children_[i]->is_tree_not_param_ = true;
}
}
} else if ((0 == func_name.case_compare("json_member_of"))) {
sql_info.ps_need_parameterized_ = false;
if (2 == tree->num_child_) {
const int64_t ARGS_NUMBER_TWO = 2;
bool mark_arr[ARGS_NUMBER_TWO] = {0, 1}; //0表示参数化, 1 表示不参数化
if (OB_FAIL(mark_args(tree, mark_arr, ARGS_NUMBER_TWO, sql_info))) {
SQL_PC_LOG(WARN, "fail to mark substr arg", K(ret));
}
}
} else if ((0 == func_name.case_compare("json_contains"))) {
sql_info.ps_need_parameterized_ = false;
for (int64_t i = 0; OB_SUCC(ret) && i < tree->num_child_; i++) {
if (OB_ISNULL(tree->children_[i])) {
ret = OB_INVALID_ARGUMENT;
SQL_PC_LOG(WARN, "invalid argument", K(ret), K(tree->children_[i]));
} else if (1 != 1) {
tree->children_[i]->is_tree_not_param_ = true;
}
}
} else if ((0 == func_name.case_compare("json_overlaps"))) {
const int64_t ARGS_NUMBER_TWO = 2;
bool mark_arr[ARGS_NUMBER_TWO] = {1, 1};
if (OB_FAIL(mark_args(node[1], mark_arr, ARGS_NUMBER_TWO, sql_info))) {
SQL_PC_LOG(WARN, "fail to mark arg", K(ret));
}
} else if ((0 == func_name.case_compare("json_schema_valid"))
|| (0 == func_name.case_compare("json_schema_validation_report"))) {
const int64_t ARGS_NUMBER_TWO = 2;