Fix base64 bug: ob doesn't return null as expected
This commit is contained in:
@ -179,7 +179,9 @@ int ObExprFromBase64::eval_from_base64_batch(const ObExpr &expr, ObEvalCtx &ctx,
|
|||||||
const ObString & in_raw = arg->get_string();
|
const ObString & in_raw = arg->get_string();
|
||||||
ObLength in_raw_len = in_raw.length();
|
ObLength in_raw_len = in_raw.length();
|
||||||
const char *buf = in_raw.ptr();
|
const char *buf = in_raw.ptr();
|
||||||
if (NULL == buf) {
|
if (arg->is_null()) {
|
||||||
|
res[j].set_null();
|
||||||
|
} else if (NULL == buf) {
|
||||||
res[j].set_string(nullptr, 0);
|
res[j].set_string(nullptr, 0);
|
||||||
} else {
|
} else {
|
||||||
char *output_buf = nullptr;
|
char *output_buf = nullptr;
|
||||||
|
|||||||
@ -172,8 +172,10 @@ int ObExprToBase64::eval_to_base64_batch(const ObExpr &expr,
|
|||||||
ObLength in_raw_len = in_raw.length();
|
ObLength in_raw_len = in_raw.length();
|
||||||
const char *buf = in_raw.ptr();
|
const char *buf = in_raw.ptr();
|
||||||
char *output_buf = nullptr;
|
char *output_buf = nullptr;
|
||||||
int64_t buf_len = base64_needed_encoded_length(in_raw_len);
|
int64_t buf_len = 0;
|
||||||
if (OB_UNLIKELY(buf_len == 0)) {
|
if (arg->is_null()) {
|
||||||
|
res[j].set_null();
|
||||||
|
} else if (OB_UNLIKELY((buf_len = base64_needed_encoded_length(in_raw_len)) == 0)) {
|
||||||
res[j].set_string(nullptr, 0);
|
res[j].set_string(nullptr, 0);
|
||||||
} else {
|
} else {
|
||||||
int64_t pos = 0;
|
int64_t pos = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user