[CP] fix core when update lob to default value in non strict sql mode

This commit is contained in:
shadowao
2024-07-17 09:17:48 +00:00
committed by ob-robot
parent 5bd36f4e5f
commit 31f4971673
2 changed files with 4 additions and 2 deletions

View File

@ -270,7 +270,7 @@ DEF_TO_STRING(ObLobLocatorV2)
int64_t pos = 0; int64_t pos = 0;
uint32_t offset = 0; uint32_t offset = 0;
J_OBJ_START(); J_OBJ_START();
J_KV(K_(ptr), K_(size), K_(has_lob_header)); J_KV(KP_(ptr), K_(size), K_(has_lob_header));
J_COMMA(); J_COMMA();
if (OB_ISNULL(ptr_)) { if (OB_ISNULL(ptr_)) {

View File

@ -4569,7 +4569,9 @@ int ObLSTabletService::process_lob_row(
// get new lob locator // get new lob locator
ObString new_lob_str = (new_obj.is_null() || new_obj.is_nop_value()) ObString new_lob_str = (new_obj.is_null() || new_obj.is_nop_value())
? ObString(0, nullptr) : new_obj.get_string(); ? ObString(0, nullptr) : new_obj.get_string();
ObLobLocatorV2 new_lob(new_lob_str, new_obj.has_lob_header()); // for not strict sql mode, will insert empty string without lob header
bool has_lob_header = new_obj.has_lob_header() && new_lob_str.length() > 0;
ObLobLocatorV2 new_lob(new_lob_str, has_lob_header);
if (OB_FAIL(ret)) { if (OB_FAIL(ret)) {
} else if (new_obj.is_null() || } else if (new_obj.is_null() ||
new_obj.is_nop_value() || new_obj.is_nop_value() ||