diff --git a/deps/oblib/src/lib/json_type/ob_json_base.cpp b/deps/oblib/src/lib/json_type/ob_json_base.cpp index 40bc155dd1..0bca255c5d 100644 --- a/deps/oblib/src/lib/json_type/ob_json_base.cpp +++ b/deps/oblib/src/lib/json_type/ob_json_base.cpp @@ -1644,7 +1644,7 @@ int ObIJsonBase::find_string_method(ObIAllocator* allocator, ObSeekParentInfo &p } } else if (!str_only) { ObJsonBuffer j_buf(allocator); - if (OB_FAIL(print(j_buf, true, false, 0, true))) { + if (OB_FAIL(print(j_buf, true, false, 0))) { trans_fail = true; } else { ObJsonString* tmp_ans = static_cast (allocator->alloc(sizeof(ObJsonString))); @@ -1728,7 +1728,7 @@ int ObIJsonBase::find_trans_method(ObIAllocator* allocator, ObSeekParentInfo &pa src = ObString(get_data_length(), get_data()); } else if (type != ObJsonNodeType::J_NULL) { ObJsonBuffer j_buf(allocator); - if (OB_FAIL(print(j_buf, true, false, 0, true))) { + if (OB_FAIL(print(j_buf, true, false, 0))) { trans_fail = true; } else { src = ObString(j_buf.length(), j_buf.ptr()); @@ -3138,7 +3138,7 @@ int ObIJsonBase::get_str_comp_result(ObIAllocator* allocator, ObSeekParentInfo & right_str = ObString(var->get_data_length(), var->get_data()); } else { ObJsonBuffer j_buf(allocator); - if (OB_FAIL(var->print(j_buf, true, false, 0, true))) { + if (OB_FAIL(var->print(j_buf, true, false, 0))) { LOG_WARN("fail to get string of sql_var.", K(ret)); } else { right_str = ObString(j_buf.length(), j_buf.ptr()); @@ -3506,7 +3506,7 @@ int ObIJsonBase::print_array(ObJsonBuffer &j_buf, uint64_t depth, bool is_pretty } if (OB_FAIL(get_array_element(i, jb_ptr))) { LOG_WARN("fail to get array element", K(ret), K(depth), K(i)); - } else if (OB_FAIL(jb_ptr->print(j_buf, true, is_pretty, depth, true))) { + } else if (OB_FAIL(jb_ptr->print(j_buf, true, is_pretty, depth))) { LOG_WARN("fail to print json value to string", K(ret), K(i), K(is_pretty), K(depth)); } } @@ -3525,7 +3525,7 @@ int ObIJsonBase::print_array(ObJsonBuffer &j_buf, uint64_t depth, bool is_pretty return ret; } -int ObIJsonBase::print_object(ObJsonBuffer &j_buf, uint64_t depth, bool is_pretty, bool format_json) const +int ObIJsonBase::print_object(ObJsonBuffer &j_buf, uint64_t depth, bool is_pretty) const { INIT_SUCC(ret); @@ -3544,7 +3544,7 @@ int ObIJsonBase::print_object(ObJsonBuffer &j_buf, uint64_t depth, bool is_prett LOG_WARN("fail to get key", K(ret), K(i)); } else if (is_pretty && OB_FAIL(ObJsonBaseUtil::append_newline_and_indent(j_buf, depth))) { LOG_WARN("fail to newline and indent", K(ret), K(depth), K(i), K(key)); - } else if (OB_FAIL(ObJsonBaseUtil::append_string(j_buf, true, key.ptr(), key.length(), format_json))) { // key + } else if (OB_FAIL(ObJsonBaseUtil::append_string(j_buf, true, key.ptr(), key.length()))) { // key LOG_WARN("fail to print string", K(ret), K(depth), K(i), K(key)); } else if (OB_FAIL(j_buf.append(":"))) { LOG_WARN("fail to append \":\"", K(ret), K(depth), K(i), K(key)); @@ -3558,7 +3558,7 @@ int ObIJsonBase::print_object(ObJsonBuffer &j_buf, uint64_t depth, bool is_prett } if (OB_FAIL(get_object_value(i, jb_ptr))) { LOG_WARN("fail to get object value", K(ret), K(i), K(is_pretty), K(depth)); - } else if (OB_FAIL(jb_ptr->print(j_buf, true, is_pretty, depth, true))) { // value + } else if (OB_FAIL(jb_ptr->print(j_buf, true, is_pretty, depth))) { // value LOG_WARN("fail to print json value to string", K(ret), K(i), K(is_pretty), K(depth)); } } @@ -3778,7 +3778,7 @@ int ObIJsonBase::print_opaque(ObJsonBuffer &j_buf, uint64_t depth, bool is_quote return ret; } -int ObIJsonBase::print(ObJsonBuffer &j_buf, bool is_quoted, bool is_pretty, uint64_t depth, bool format_json) const +int ObIJsonBase::print(ObJsonBuffer &j_buf, bool is_quoted, bool is_pretty, uint64_t depth) const { INIT_SUCC(ret); ObJsonNodeType j_type = json_type(); @@ -3814,7 +3814,7 @@ int ObIJsonBase::print(ObJsonBuffer &j_buf, bool is_quoted, bool is_pretty, uint if (ObJsonParser::is_json_doc_over_depth(++depth)) { ret = OB_ERR_JSON_OUT_OF_DEPTH; LOG_WARN("current json over depth", K(ret), K(depth), K(j_type)); - } else if (OB_FAIL(print_object(j_buf, depth, is_pretty, format_json))) { + } else if (OB_FAIL(print_object(j_buf, depth, is_pretty))) { LOG_WARN("fail to print object to string", K(ret), K(depth), K(j_type), K(is_pretty)); } break; @@ -3883,7 +3883,7 @@ int ObIJsonBase::print(ObJsonBuffer &j_buf, bool is_quoted, bool is_pretty, uint } else if (OB_ISNULL(data) && data_len != 0) { ret = OB_ERR_NULL_VALUE; LOG_WARN("data is null", K(ret), K(data_len)); - } else if (OB_FAIL(ObJsonBaseUtil::append_string(j_buf, is_quoted, data, data_len, format_json))) { + } else if (OB_FAIL(ObJsonBaseUtil::append_string(j_buf, is_quoted, data, data_len))) { // if data is null, data_len is 0, it is an empty string LOG_WARN("fail to append string", K(ret), K(j_type), K(is_quoted)); } @@ -6250,23 +6250,13 @@ int ObJsonBaseUtil::add_double_quote(ObJsonBuffer &j_buf, const char *cptr, uint } int ObJsonBaseUtil::append_string(ObJsonBuffer &j_buf, bool is_quoted, - const char *data, uint64_t length, bool format_json) + const char *data, uint64_t length) { INIT_SUCC(ret); if (is_quoted) { - if (lib::is_oracle_mode() && !format_json) { - if (OB_FAIL(j_buf.append("\"", 1))) { - LOG_WARN("fail to append \"", K(ret)); - } else if (OB_FAIL(j_buf.append(data, length))) { - LOG_WARN("fail to append data", K(ret), K(length)); - } else if (OB_FAIL(j_buf.append("\"", 1))) { - LOG_WARN("fail to append \"", K(ret)); - } - } else { - if (OB_FAIL(ObJsonBaseUtil::add_double_quote(j_buf, data, length))) { - LOG_WARN("fail to add double quote", K(ret), K(length)); - } + if (OB_FAIL(ObJsonBaseUtil::add_double_quote(j_buf, data, length))) { + LOG_WARN("fail to add double quote", K(ret), K(length)); } } else { if (OB_FAIL(j_buf.append(data, length))) { diff --git a/deps/oblib/src/lib/json_type/ob_json_base.h b/deps/oblib/src/lib/json_type/ob_json_base.h index 59b8acb716..2c6e96b82f 100644 --- a/deps/oblib/src/lib/json_type/ob_json_base.h +++ b/deps/oblib/src/lib/json_type/ob_json_base.h @@ -250,7 +250,7 @@ public: // @param [in] depth The depth of json tree. // @return Returns OB_SUCCESS on success, error code otherwise. virtual int print(ObJsonBuffer &j_buf, bool is_quoted, - bool is_pretty = false, uint64_t depth = 0, bool format_json = false) const; + bool is_pretty = false, uint64_t depth = 0) const; // calculate json hash value // @@ -361,7 +361,7 @@ private: // @param [in] depth The depth of json tree. // @param [in] is_pretty Whether is from json funcion JSON_PRETTY or not. // @return Returns OB_SUCCESS on success, error code otherwise. - int print_object(ObJsonBuffer &j_buf, uint64_t depth, bool is_pretty, bool format_json = false) const; + int print_object(ObJsonBuffer &j_buf, uint64_t depth, bool is_pretty) const; // Change json decimal to string. // @@ -1075,7 +1075,7 @@ public: // @param [in] data The source string. // @param [in] length The length of source string. // @return Returns OB_SUCCESS on success, error code otherwise. - static int append_string(ObJsonBuffer &j_buf, bool is_quoted, const char *data, uint64_t length, bool format_json = false); + static int append_string(ObJsonBuffer &j_buf, bool is_quoted, const char *data, uint64_t length); // Compare two numbers. // diff --git a/deps/oblib/src/rpc/obmysql/ob_mysql_util.cpp b/deps/oblib/src/rpc/obmysql/ob_mysql_util.cpp index 6364295f8f..fb39c5c2f6 100644 --- a/deps/oblib/src/rpc/obmysql/ob_mysql_util.cpp +++ b/deps/oblib/src/rpc/obmysql/ob_mysql_util.cpp @@ -1057,10 +1057,8 @@ int ObMySQLUtil::json_cell_str(char *buf, const int64_t len, const ObString &val } } else if (OB_FAIL(j_bin.reset_iter())) { OB_LOG(WARN, "fail to reset json bin iter", K(ret), K(val)); - } else if (lib::is_mysql_mode() && OB_FAIL(j_base->print(jbuf, true))) { + } else if (OB_FAIL(j_base->print(jbuf, true))) { OB_LOG(WARN, "json binary to string failed in mysql mode", K(ret), K(val), K(*j_base)); - } else if (lib::is_oracle_mode() && OB_FAIL(j_base->print(jbuf, true, false, 0, true))) { - OB_LOG(WARN, "json binary to string failed in oracle mode", K(ret), K(val), K(*j_base)); } else { int64_t new_length = jbuf.length(); if (OB_LIKELY(new_length < len - pos)) { diff --git a/src/sql/engine/aggregate/ob_aggregate_processor.cpp b/src/sql/engine/aggregate/ob_aggregate_processor.cpp index a2886ba220..b1d56e5a91 100644 --- a/src/sql/engine/aggregate/ob_aggregate_processor.cpp +++ b/src/sql/engine/aggregate/ob_aggregate_processor.cpp @@ -6231,7 +6231,7 @@ int ObAggregateProcessor::get_ora_json_objectagg_result(const ObAggrInfo &aggr_i } ObJsonString ob_str(key_string.ptr(), key_string.length()); if (OB_FAIL(ret)) { - } else if (OB_FAIL(ob_str.print(json_object_buf, true, false, 0, true))) { + } else if (OB_FAIL(ob_str.print(json_object_buf, true))) { LOG_WARN("fail to print json node", K(ret)); } else if (OB_FAIL(json_object_buf.append(":"))) { LOG_WARN("fail to append colon", K(ret)); diff --git a/src/sql/engine/basic/ob_json_table_op.cpp b/src/sql/engine/basic/ob_json_table_op.cpp index 87fdff5619..dd231a4c6d 100644 --- a/src/sql/engine/basic/ob_json_table_op.cpp +++ b/src/sql/engine/basic/ob_json_table_op.cpp @@ -335,7 +335,8 @@ int JtFuncHelpler::cast_to_string(JtColNode* node, ObObjType dst_type, ObString &val, bool is_trunc, - bool is_quote) + bool is_quote, + bool is_const) { INIT_SUCC(ret); @@ -380,8 +381,7 @@ int JtFuncHelpler::cast_to_string(JtColNode* node, // just copy string when in_cs_type or out_cs_type is binary const ObCharsetInfo *cs = NULL; int64_t align_offset = 0; - if (CS_TYPE_BINARY == in_cs_type && lib::is_mysql_mode() - && (NULL != (cs = ObCharset::get_charset(dst_cs_type)))) { + if (CS_TYPE_BINARY == in_cs_type && (NULL != (cs = ObCharset::get_charset(dst_cs_type)))) { if (cs->mbminlen > 0 && temp_str_val.length() % cs->mbminlen != 0) { align_offset = cs->mbminlen - temp_str_val.length() % cs->mbminlen; } @@ -419,13 +419,14 @@ int JtFuncHelpler::cast_to_string(JtColNode* node, if (OB_SUCC(ret)) { if (max_accuracy_len == DEFAULT_STR_LENGTH) { // default string len } else if (is_trunc && max_accuracy_len < str_len_char) { - if (node->col_info_.col_type_ == static_cast(COL_TYPE_EXISTS) - || j_base->json_type() == ObJsonNodeType::J_INT - || j_base->json_type() == ObJsonNodeType::J_UINT - || j_base->json_type() == ObJsonNodeType::J_BOOLEAN - || j_base->json_type() == ObJsonNodeType::J_DOUBLE - || j_base->json_type() == ObJsonNodeType::J_DECIMAL) { - ret = OB_OPERATE_OVERFLOW; + if (!is_const && + (node->col_info_.col_type_ == static_cast(COL_TYPE_EXISTS) + || j_base->json_type() == ObJsonNodeType::J_INT + || j_base->json_type() == ObJsonNodeType::J_UINT + || j_base->json_type() == ObJsonNodeType::J_BOOLEAN + || j_base->json_type() == ObJsonNodeType::J_DOUBLE + || j_base->json_type() == ObJsonNodeType::J_DECIMAL)) { + ret = OB_ERR_VALUE_EXCEEDED_MAX; } else { // bugfix: https://work.aone.alibaba-inc.com/issue/46640577 // Q1:SELECT c1 ,jt.ww b_c1 FROM t1, json_table ( c2 columns( ww varchar2(2 char) truncate path '$.a')) jt ; @@ -886,7 +887,8 @@ int JtFuncHelpler::cast_to_res(JtScanCtx* ctx, ObIJsonBase* js_val, JtColNode& c case ObLongTextType: { ObString val; bool is_quote = (col_info.col_type_ == COL_TYPE_QUERY && js_val->json_type() == ObJsonNodeType::J_STRING); - ret = cast_to_string(&col_node, &ctx->row_alloc_, js_val, in_coll_type, dst_coll_type, accuracy, dst_type, val, is_truncate, is_quote); + ret = cast_to_string(&col_node, &ctx->row_alloc_, js_val, in_coll_type, dst_coll_type, + accuracy, dst_type, val, is_truncate, is_quote, ctx->is_const_input_); if (OB_FAIL(ret) && enable_error) { int tmp_ret = set_error_val(ctx, col_node, ret); if (tmp_ret != OB_SUCCESS) { @@ -956,8 +958,9 @@ int JtFuncHelpler::set_error_val(JtScanCtx* ctx, JtColNode& col_node, int& ret) } else { const ObJtColInfo& info = col_node.col_info_; JtColType col_type = col_node.type(); + ObExpr* expr = ctx->spec_ptr_->column_exprs_.at(col_node.col_info_.output_column_idx_); if (col_type == COL_TYPE_VALUE) { - if (info.on_error_ == JSN_VALUE_ERROR || info.on_empty_ == JSN_VALUE_ERROR) { + if (info.on_error_ == JSN_VALUE_ERROR || (info.on_error_ == JSN_VALUE_IMPLICIT && info.on_empty_ == JSN_VALUE_ERROR)) { EVAL_COVER_CODE(ctx, ret) ; if (OB_SUCC(ret) && ctx->is_need_end_) { ret = OB_ITER_END; @@ -965,6 +968,7 @@ int JtFuncHelpler::set_error_val(JtScanCtx* ctx, JtColNode& col_node, int& ret) } else if (info.on_error_ == JSN_VALUE_DEFAULT) { ObExpr* default_expr = ctx->spec_ptr_->err_default_exprs_.at(col_node.col_info_.error_expr_id_); ObDatum* err_datum = nullptr; + col_node.is_null_result_ = false; tmp_ret = default_expr->eval(*ctx->eval_ctx_, err_datum); if (tmp_ret != OB_SUCCESS) { LOG_WARN("failed do cast to returning type.", K(tmp_ret)); @@ -1074,15 +1078,16 @@ int JtFuncHelpler::set_error_val(JtScanCtx* ctx, JtColNode& col_node, int& ret) } } - if (OB_SUCC(ret)) { - if (col_node.is_null_result_) { - ObExpr* expr = ctx->spec_ptr_->column_exprs_.at(col_node.col_info_.output_column_idx_); - expr->locate_datum_for_write(*ctx->eval_ctx_).set_null(); - } else if (OB_FAIL(JtFuncHelpler::cast_to_res(ctx, col_node.curr_, col_node, false))) { - LOG_WARN("failed do cast defaut value to returning type.", K(ret)); - } + if (OB_SUCC(ret) + && !col_node.is_null_result_ + && OB_FAIL(JtFuncHelpler::cast_to_res(ctx, col_node.curr_, col_node, false))) { + LOG_WARN("failed do cast defaut value to returning type.", K(ret)); } } + + if (OB_SUCC(ret) && col_node.is_null_result_) { + expr->locate_datum_for_write(*ctx->eval_ctx_).set_null(); + } } return ret; } @@ -1159,8 +1164,7 @@ int JtFuncHelpler::check_default_value_inner(JtScanCtx* ctx, in_str.assign_ptr(emp_datum->ptr_, emp_datum->len_); } if (OB_FAIL(ret)) { - } else if ((default_expr->datum_meta_.type_ == ObNullType || emp_datum->is_null()) - && ob_is_string_type(col_info.data_type_.get_obj_type())) { + } else if (default_expr->datum_meta_.type_ == ObNullType && ob_is_string_type(col_info.data_type_.get_obj_type())) { ret = OB_ERR_DEFAULT_VALUE_NOT_LITERAL; LOG_WARN("default value not match returing type", K(ret)); } else if (OB_FAIL(ObJsonExprHelper::pre_default_value_check(col_expr->datum_meta_.type_, in_str, default_expr->datum_meta_.type_))) { @@ -2631,9 +2635,9 @@ int ObJsonTableOp::init() } jt_ctx_.is_cover_error_ = false; + jt_ctx_.is_const_input_ = !MY_SPEC.has_correlated_expr_; jt_ctx_.error_code_ = 0; jt_ctx_.is_need_end_ = 0; - return ret; } @@ -2690,7 +2694,10 @@ int ObJsonTableOp::inner_get_next_row() if (doc_type == ObNullType) { ret = OB_ITER_END; - } else if (doc_type == ObNCharType || !(doc_type == ObJsonType || ob_is_string_type(doc_type))) { + } else if (doc_type == ObNCharType || + !(doc_type == ObJsonType + || doc_type == ObRawType + || ob_is_string_type(doc_type))) { ret = OB_ERR_INPUT_JSON_TABLE; LOG_WARN("fail to get json base", K(ret), K(doc_type)); } else { diff --git a/src/sql/engine/basic/ob_json_table_op.h b/src/sql/engine/basic/ob_json_table_op.h index 7d5e023114..efcb7f0884 100644 --- a/src/sql/engine/basic/ob_json_table_op.h +++ b/src/sql/engine/basic/ob_json_table_op.h @@ -294,7 +294,8 @@ public: ObObjType dst_type, ObString &val, bool is_trunc = false, - bool is_quote = false); + bool is_quote = false, + bool is_const = false); static int time_scale_check(const ObAccuracy &accuracy, int64_t &value, bool strict = false); static int datetime_scale_check(const ObAccuracy &accuracy, int64_t &value, bool strict = false); static int number_range_check(const ObAccuracy &accuracy, @@ -373,6 +374,7 @@ struct JtScanCtx { bool is_cover_error_; bool is_need_end_; bool is_charset_converted_; + bool is_const_input_; int error_code_; int32_t ord_val_; ObDatum* res_obj_; diff --git a/src/sql/engine/expr/ob_datum_cast.cpp b/src/sql/engine/expr/ob_datum_cast.cpp index a3a1c06f16..47e4f115ad 100644 --- a/src/sql/engine/expr/ob_datum_cast.cpp +++ b/src/sql/engine/expr/ob_datum_cast.cpp @@ -1821,7 +1821,7 @@ static int common_json_string(const ObExpr &expr, // get json string if (OB_FAIL(j_bin.reset_iter())) { LOG_WARN("failed to reset json bin iter", K(ret), K(j_bin_str)); - } else if (CAST_FAIL(j_base->print(j_buf, true, false, 0, true))) { + } else if (CAST_FAIL(j_base->print(j_buf, true))) { LOG_WARN("fail to convert json to string", K(ret), K(j_bin_str)); ret = OB_ERR_INVALID_JSON_VALUE_FOR_CAST; LOG_USER_ERROR(OB_ERR_INVALID_JSON_VALUE_FOR_CAST); @@ -7029,7 +7029,7 @@ CAST_FUNC_NAME(json, raw) if (OB_FAIL(j_bin.reset_iter())) { LOG_WARN("failed to reset json bin iter", K(ret), K(j_bin_str)); - } else if (CAST_FAIL(j_base->print(j_buf, true, false, 0, true))) { + } else if (CAST_FAIL(j_base->print(j_buf, true))) { LOG_WARN("fail to convert json to string", K(ret), K(j_bin_str)); ret = OB_ERR_INVALID_JSON_VALUE_FOR_CAST; LOG_USER_ERROR(OB_ERR_INVALID_JSON_VALUE_FOR_CAST); @@ -7078,7 +7078,7 @@ CAST_FUNC_NAME(json, string) if (OB_FAIL(j_bin.reset_iter())) { LOG_WARN("failed to reset json bin iter", K(ret), K(j_bin_str)); - } else if (CAST_FAIL(j_base->print(j_buf, true, false, 0, true))) { + } else if (CAST_FAIL(j_base->print(j_buf, true))) { LOG_WARN("fail to convert json to string", K(ret), K(j_bin_str)); ret = OB_ERR_INVALID_JSON_VALUE_FOR_CAST; LOG_USER_ERROR(OB_ERR_INVALID_JSON_VALUE_FOR_CAST); diff --git a/src/sql/engine/expr/ob_expr_json_func_helper.cpp b/src/sql/engine/expr/ob_expr_json_func_helper.cpp index 78032d16ba..778d72ea80 100644 --- a/src/sql/engine/expr/ob_expr_json_func_helper.cpp +++ b/src/sql/engine/expr/ob_expr_json_func_helper.cpp @@ -186,7 +186,7 @@ int ObJsonExprHelper::cast_to_json_tree(ObString &text, common::ObIAllocator *al LOG_WARN("get json tree fail", K(ret)); } else { ObJsonBuffer jbuf(allocator); - if (OB_FAIL(j_tree->print(jbuf, true, false, 0, true))) { + if (OB_FAIL(j_tree->print(jbuf, true, false, 0))) { LOG_WARN("json binary to string failed", K(ret)); } else if (jbuf.empty()) { ret = OB_ALLOCATE_MEMORY_FAILED; @@ -1162,7 +1162,7 @@ int ObJsonExprHelper::transform_convertible_2String(const ObExpr &expr, } } else { ObJsonString ob_str(value.ptr(), value.length()); - if (OB_FAIL(ob_str.print(j_buf, true, false, 0, true))) { + if (OB_FAIL(ob_str.print(j_buf, true, false, 0))) { LOG_WARN("fail to print json node", K(ret)); } } @@ -1178,7 +1178,7 @@ int ObJsonExprHelper::transform_convertible_2String(const ObExpr &expr, ObJsonInType::JSON_BIN, json_node))) { ret = OB_ERR_INVALID_JSON_TEXT_IN_PARAM; LOG_WARN("fail to get json base", K(ret)); - } else if (OB_FAIL(json_node->print(j_buf, true, false, 0, true))) { + } else if (OB_FAIL(json_node->print(j_buf, true, false, 0))) { LOG_WARN("fail to print json node", K(ret)); } break; diff --git a/src/sql/engine/expr/ob_expr_json_object.cpp b/src/sql/engine/expr/ob_expr_json_object.cpp index 5f987627f7..d36d8b8ed1 100644 --- a/src/sql/engine/expr/ob_expr_json_object.cpp +++ b/src/sql/engine/expr/ob_expr_json_object.cpp @@ -374,7 +374,7 @@ int ObExprJsonObject::eval_ora_json_object(const ObExpr &expr, ObEvalCtx &ctx, O if (OB_SUCC(ret)) { if (unique_type == OB_JSON_ON_UNIQUE_USE && OB_FAIL(check_key_valid(view_key_names, key))) { LOG_WARN("duplicate key fail"); - } else if (OB_FAIL(ob_str.print(res_str, true, false, 0, true))) { + } else if (OB_FAIL(ob_str.print(res_str, true))) { LOG_WARN("fail to print json node", K(ret)); } else if (OB_FAIL(res_str.append(":"))) { LOG_WARN("colon write fail"); @@ -391,7 +391,7 @@ int ObExprJsonObject::eval_ora_json_object(const ObExpr &expr, ObEvalCtx &ctx, O if (OB_SUCC(ret)) { if (unique_type == OB_JSON_ON_UNIQUE_USE && OB_FAIL(check_key_valid(view_key_names, key))) { LOG_WARN("duplicate key fail"); - } else if (OB_FAIL(ob_str.print(res_str, true, false, 0, true))) { + } else if (OB_FAIL(ob_str.print(res_str, true))) { LOG_WARN("fail to print json node", K(ret)); } else if (OB_FAIL(res_str.append(":"))) { LOG_WARN("colon write fail"); diff --git a/src/sql/engine/expr/ob_expr_json_pretty.cpp b/src/sql/engine/expr/ob_expr_json_pretty.cpp index 219bed4e02..5c2e4d54bb 100644 --- a/src/sql/engine/expr/ob_expr_json_pretty.cpp +++ b/src/sql/engine/expr/ob_expr_json_pretty.cpp @@ -81,7 +81,7 @@ int ObExprJsonPretty::calc(ObEvalCtx &ctx, const ObDatum &data, ObDatumMeta meta ret = OB_ERR_INVALID_JSON_TEXT_IN_PARAM; } LOG_WARN("fail to get json base", K(ret), K(type), K(j_str), K(j_in_type)); - } else if (OB_FAIL(j_base->print(j_buf, true, true, 0, true))) { + } else if (OB_FAIL(j_base->print(j_buf, true, true, 0))) { LOG_WARN("fail to print json", K(ret), K(type), K(j_str), K(j_in_type)); } diff --git a/src/sql/engine/expr/ob_expr_json_query.cpp b/src/sql/engine/expr/ob_expr_json_query.cpp index f8c222e882..1c3dc830d0 100644 --- a/src/sql/engine/expr/ob_expr_json_query.cpp +++ b/src/sql/engine/expr/ob_expr_json_query.cpp @@ -461,7 +461,7 @@ int ObExprJsonQuery::set_result(ObObjType dst_type, if (dst_type == ObVarcharType || dst_type == ObLongTextType) { ObJsonBuffer jbuf(allocator); ObString res_string; - if (OB_FAIL(jb_res->print(jbuf, true, pretty_type > 0, 0, true))) { + if (OB_FAIL(jb_res->print(jbuf, true, pretty_type > 0))) { LOG_WARN("json binary to string failed", K(ret)); } else if (jbuf.empty()) { ret = OB_ALLOCATE_MEMORY_FAILED;