[CP]:sync json pl manage from 42x to master

This commit is contained in:
obdev
2024-04-15 17:15:51 +00:00
committed by ob-robot
parent dd7737c7ab
commit 072fdf7c6e
13 changed files with 744 additions and 79 deletions

View File

@ -579,7 +579,8 @@ ObJsonNode *ObJsonObject::clone(ObIAllocator* allocator, bool is_deep_copy) cons
for (uint64_t i = 0; i < len && OB_SUCC(ret); i++) {
if (is_deep_copy) {
char* str_buf = NULL;
if (OB_ISNULL(str_buf = static_cast<char*>(allocator->alloc(object_array_[i].get_key().length())))) {
bool is_key_empty = object_array_[i].get_key().length() == 0;
if (!is_key_empty && OB_ISNULL(str_buf = static_cast<char*>(allocator->alloc(object_array_[i].get_key().length())))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("allocate memory failed", K(ret), K(object_array_[i].get_key().length()));
} else {