[json/xml/gis/lob]codescan ret miss and overwrite
This commit is contained in:
parent
1ee64365ea
commit
eabb1ecfb0
@ -254,7 +254,8 @@ int ObWkbToS2Visitor::MakeS2Polygon(T_IBIN *geo, S2Polygon *&res)
|
||||
}
|
||||
|
||||
S2Polygon* py = new S2Polygon(std::move(s2poly));
|
||||
if (OB_ISNULL(py)) {
|
||||
if (OB_FAIL(ret)) {
|
||||
} else if (OB_ISNULL(py)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("failed to alloc s2cell", K(ret));
|
||||
} else {
|
||||
@ -324,7 +325,8 @@ int ObWkbToS2Visitor::MakeProjS2Polygon(T_IBIN *geo, S2Polygon *&res)
|
||||
}
|
||||
|
||||
S2Polygon* py = new S2Polygon(std::move(s2poly));
|
||||
if (OB_ISNULL(py)) {
|
||||
if (OB_FAIL(ret)) {
|
||||
} else if (OB_ISNULL(py)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("failed to alloc s2cell", K(ret));
|
||||
} else {
|
||||
|
@ -227,8 +227,8 @@ void ObLibXml2SaxHandler::characters(void *ctx, const xmlChar *ch, int len)
|
||||
LOG_WARN("get_parser failed", K(ret));
|
||||
} else if (OB_UNLIKELY(parser->is_stop_parse())) {
|
||||
LOG_INFO("parser is stopped", K(parser->get_last_errno()));
|
||||
} else if (parser->characters(reinterpret_cast<const char*>(ch),
|
||||
len)) {
|
||||
} else if (OB_FAIL(parser->characters(reinterpret_cast<const char*>(ch),
|
||||
len))) {
|
||||
LOG_WARN("parser characters failed", K(ret));
|
||||
}
|
||||
|
||||
@ -246,9 +246,9 @@ void ObLibXml2SaxHandler::cdata_block(void* ctx, const xmlChar* value, int len)
|
||||
LOG_WARN("get_parser failed", K(ret));
|
||||
} else if (OB_UNLIKELY(parser->is_stop_parse())) {
|
||||
LOG_INFO("parser is stopped", K(parser->get_last_errno()));
|
||||
} else if (parser->add_text_node(ObMulModeNodeType::M_CDATA,
|
||||
} else if (OB_FAIL(parser->add_text_node(ObMulModeNodeType::M_CDATA,
|
||||
reinterpret_cast<const char*>(value),
|
||||
len)) {
|
||||
len))) {
|
||||
LOG_WARN("parser cdata block failed", K(ret));
|
||||
}
|
||||
|
||||
@ -268,9 +268,9 @@ void ObLibXml2SaxHandler::comment(void* ctx, const xmlChar* value)
|
||||
LOG_WARN("get_parser failed", K(ret));
|
||||
} else if (OB_UNLIKELY(parser->is_stop_parse())) {
|
||||
LOG_INFO("parser is stopped", K(parser->get_last_errno()));
|
||||
} else if (parser->add_text_node(ObMulModeNodeType::M_COMMENT,
|
||||
} else if (OB_FAIL(parser->add_text_node(ObMulModeNodeType::M_COMMENT,
|
||||
src_value,
|
||||
STRLEN(src_value))) {
|
||||
STRLEN(src_value)))) {
|
||||
LOG_WARN("parser comment failed", K(ret));
|
||||
}
|
||||
|
||||
|
@ -644,7 +644,7 @@ int ObIMulModeBase::print_cdata(ObStringBuffer& x_buf, uint32_t format_flag)
|
||||
if (OB_FAIL(get_value(value))) {
|
||||
LOG_WARN("fail to get value.", K(ret));
|
||||
} else if (format_flag & ObXmlFormatType::PRINT_CDATA_AS_TEXT) {
|
||||
if (ObXmlParserUtils::escape_xml_text(value, x_buf)) {
|
||||
if (OB_FAIL(ObXmlParserUtils::escape_xml_text(value, x_buf))) {
|
||||
LOG_WARN("fail to print escape text", K(ret));
|
||||
}
|
||||
} else if (OB_FAIL(x_buf.append("<![CDATA["))) {
|
||||
|
2
deps/oblib/src/lib/xml/ob_xml_util.cpp
vendored
2
deps/oblib/src/lib/xml/ob_xml_util.cpp
vendored
@ -516,7 +516,7 @@ int ObXmlUtil::xml_bin_to_text(
|
||||
LOG_WARN("fail to get xml base", K(ret), K(bin));
|
||||
} else if (OB_FAIL(base->print(*buffer, 0, 0, 0, CS_TYPE_UTF8MB4_GENERAL_CI))) {
|
||||
LOG_WARN("print_document failed", K(ret));
|
||||
} else if (ob_write_string(allocator, buffer->string(), text)) {
|
||||
} else if (OB_FAIL(ob_write_string(allocator, buffer->string(), text))) {
|
||||
LOG_WARN("ob_write_string failed", K(ret), K(*buffer));
|
||||
}
|
||||
return ret;
|
||||
|
@ -267,6 +267,7 @@ int ObSchemaGetterGuard::get_can_read_index_array(
|
||||
if (OB_FAIL(index_schema->get_spatial_geo_column_id(geo_col_id))) {
|
||||
LOG_WARN("failed to get geometry column id", K(ret));
|
||||
} else if (OB_ISNULL(geo_column = table_schema->get_column_schema(geo_col_id))) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("failed to get geometry column", K(ret), K(geo_col_id));
|
||||
} else if (geo_column->is_default_srid()) {
|
||||
is_geo_default_srid = true;
|
||||
|
@ -395,6 +395,7 @@ int ObExprJsonMergePatch::eval_ora_json_merge_patch(const ObExpr &expr, ObEvalCt
|
||||
if (dst_type == ObVarcharType && length > dst_len) {
|
||||
char res_ptr[OB_MAX_DECIMAL_PRECISION] = {0};
|
||||
if (OB_ISNULL(ObCharset::lltostr(dst_len, res_ptr, 10, 1))) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("failed to lltostr", K(ret), K(dst_len));
|
||||
}
|
||||
if (!err_type) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user