fix string type null value error in dblink.
This commit is contained in:
6
deps/oblib/src/common/object/ob_obj_funcs.h
vendored
6
deps/oblib/src/common/object/ob_obj_funcs.h
vendored
@ -97,7 +97,11 @@ template <>
|
||||
UNUSED(obj);
|
||||
UNUSED(params);
|
||||
int ret = OB_SUCCESS;
|
||||
ret = databuff_printf(buffer, length, pos, "NULL");
|
||||
if (params.print_null_string_value_) {
|
||||
ret = databuff_printf(buffer, length, pos, "''");
|
||||
} else {
|
||||
ret = databuff_printf(buffer, length, pos, "NULL");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
template <>
|
||||
|
||||
3
deps/oblib/src/common/object/ob_object.h
vendored
3
deps/oblib/src/common/object/ob_object.h
vendored
@ -1115,7 +1115,8 @@ struct ObObjPrintParams
|
||||
uint32_t binary_string_print_hex_:1;
|
||||
uint32_t need_print_converter_:1;
|
||||
uint32_t print_const_expr_type_:1;
|
||||
uint32_t reserved_:23;
|
||||
uint32_t print_null_string_value_:1;
|
||||
uint32_t reserved_:22;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -240,6 +240,10 @@ int ObLinkOp::combine_link_stmt(const ObString &link_stmt_fmt,
|
||||
int64_t param_idx = param_infos.at(next_param).idx_;
|
||||
const ObObjParam ¶m = param_store.at(param_idx);
|
||||
ObObjPrintParams obj_print_params = CREATE_OBJ_PRINT_PARAM(ctx_.get_my_session());
|
||||
|
||||
if (lib::is_oracle_mode() && ObSQLUtils::is_oracle_empty_string(param)) {
|
||||
obj_print_params.print_null_string_value_ = true;
|
||||
}
|
||||
if (DBLINK_DRV_OCI == link_type_) {
|
||||
// Ensure that when oceanbase connects to oracle,
|
||||
// the target character set of param is the same as that of oci connection.
|
||||
|
||||
Reference in New Issue
Block a user