bugfix:49228442, 49192441, 49243082, 49336026, 49341756, 49424274, 49428667, 49263419
This commit is contained in:
parent
8a215cb58f
commit
e38a0ec7ca
2
deps/oblib/src/common/object/ob_obj_type.cpp
vendored
2
deps/oblib/src/common/object/ob_obj_type.cpp
vendored
@ -707,7 +707,7 @@ int ob_sql_type_str(char *buff,
|
|||||||
if (OB_FAIL(ob_geometry_sub_type_str(buff, buff_length, pos, static_cast<common::ObGeoType>(sub_type)))) {
|
if (OB_FAIL(ob_geometry_sub_type_str(buff, buff_length, pos, static_cast<common::ObGeoType>(sub_type)))) {
|
||||||
LOG_WARN("fail to get geometry sub type str", K(ret), K(sub_type), K(buff), K(buff_length), K(pos));
|
LOG_WARN("fail to get geometry sub type str", K(ret), K(sub_type), K(buff), K(buff_length), K(pos));
|
||||||
}
|
}
|
||||||
} else if (lib::is_oracle_mode() && ob_is_user_defined_sql_type(type)) {
|
} else if (lib::is_oracle_mode() && (ob_is_user_defined_sql_type(type) || sub_type == T_OBJ_XML)) {
|
||||||
if (OB_FAIL(ob_udt_sub_type_str(buff, buff_length, pos, sub_type, true))) {
|
if (OB_FAIL(ob_udt_sub_type_str(buff, buff_length, pos, sub_type, true))) {
|
||||||
LOG_WARN("fail to get udt sub type str", K(ret), K(sub_type), K(buff), K(buff_length), K(pos));
|
LOG_WARN("fail to get udt sub type str", K(ret), K(sub_type), K(buff), K(buff_length), K(pos));
|
||||||
}
|
}
|
||||||
|
@ -761,6 +761,8 @@ int ObTableColumns::deduce_column_attributes(
|
|||||||
}
|
}
|
||||||
} else if (result_type.is_user_defined_sql_type()) {
|
} else if (result_type.is_user_defined_sql_type()) {
|
||||||
sub_type = result_type.get_subschema_id();
|
sub_type = result_type.get_subschema_id();
|
||||||
|
} else if (result_type.get_udt_id() == T_OBJ_XML) {
|
||||||
|
sub_type = T_OBJ_XML;
|
||||||
}
|
}
|
||||||
if (OB_SUCC(ret)) {
|
if (OB_SUCC(ret)) {
|
||||||
int64_t pos = 0;
|
int64_t pos = 0;
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1885,7 +1885,10 @@ DEFINE_ORACLE_ERROR(OB_EXTRACTVALUE_NOT_LEAF_NODE, -7410, -1, "42000", "EXTRACTV
|
|||||||
DEFINE_ORACLE_ERROR(OB_XML_INSERT_FRAGMENT, -7411, -1, "42000", "Cannot insert XML fragments", 19010, "Cannot insert XML fragments");
|
DEFINE_ORACLE_ERROR(OB_XML_INSERT_FRAGMENT, -7411, -1, "42000", "Cannot insert XML fragments", 19010, "Cannot insert XML fragments");
|
||||||
DEFINE_ORACLE_ERROR(OB_ERR_NO_ORDER_MAP_SQL, -7412, -1, "42000", "cannot ORDER objects without MAP or ORDER method", 22950, "cannot ORDER objects without MAP or ORDER method");
|
DEFINE_ORACLE_ERROR(OB_ERR_NO_ORDER_MAP_SQL, -7412, -1, "42000", "cannot ORDER objects without MAP or ORDER method", 22950, "cannot ORDER objects without MAP or ORDER method");
|
||||||
DEFINE_ORACLE_ERROR(OB_ERR_XMLELEMENT_ALIASED, -7413, -1, "42000", "parameter 1 of function XMLELEMENT must be aliased", 19208, "parameter 1 of function XMLELEMENT must be aliased");
|
DEFINE_ORACLE_ERROR(OB_ERR_XMLELEMENT_ALIASED, -7413, -1, "42000", "parameter 1 of function XMLELEMENT must be aliased", 19208, "parameter 1 of function XMLELEMENT must be aliased");
|
||||||
|
DEFINE_ORACLE_ERROR(OB_INVALID_ALTERATIONG_DATATYPE, -7414, -1, "42000", "invalid alteration of datatype", 22858, "invalid alteration of datatype");
|
||||||
|
DEFINE_ORACLE_ERROR(OB_INVALID_MODIFICATION_OF_COLUMNS, -7415, -1, "42000", "invalid modification of columns", 22859, "invalid modification of columns");
|
||||||
|
DEFINE_ORACLE_ERROR(OB_ERR_NULL_FOR_XML_CONSTRUCTOR, -7416, -1, "42000", "Expected XML tag , got no content", 19032, "Expected XML tag , got no content");
|
||||||
|
DEFINE_ORACLE_ERROR(OB_ERR_XML_INDEX, -7417, -1, "42000", "cannot create index on expression with datatype ADT '%.*s'", 2327 ,"cannot create index on expression with datatype ADT '%.*s'");
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
// !!! Fatal errors and the client should close the connection, -8000 ~ -8999
|
// !!! Fatal errors and the client should close the connection, -8000 ~ -8999
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
|
@ -1403,6 +1403,10 @@ constexpr int OB_EXTRACTVALUE_NOT_LEAF_NODE = -7410;
|
|||||||
constexpr int OB_XML_INSERT_FRAGMENT = -7411;
|
constexpr int OB_XML_INSERT_FRAGMENT = -7411;
|
||||||
constexpr int OB_ERR_NO_ORDER_MAP_SQL = -7412;
|
constexpr int OB_ERR_NO_ORDER_MAP_SQL = -7412;
|
||||||
constexpr int OB_ERR_XMLELEMENT_ALIASED = -7413;
|
constexpr int OB_ERR_XMLELEMENT_ALIASED = -7413;
|
||||||
|
constexpr int OB_INVALID_ALTERATIONG_DATATYPE = -7414;
|
||||||
|
constexpr int OB_INVALID_MODIFICATION_OF_COLUMNS = -7415;
|
||||||
|
constexpr int OB_ERR_NULL_FOR_XML_CONSTRUCTOR = -7416;
|
||||||
|
constexpr int OB_ERR_XML_INDEX = -7417;
|
||||||
constexpr int OB_SERVER_IS_INIT = -8001;
|
constexpr int OB_SERVER_IS_INIT = -8001;
|
||||||
constexpr int OB_SERVER_IS_STOPPING = -8002;
|
constexpr int OB_SERVER_IS_STOPPING = -8002;
|
||||||
constexpr int OB_PACKET_CHECKSUM_ERROR = -8003;
|
constexpr int OB_PACKET_CHECKSUM_ERROR = -8003;
|
||||||
@ -3451,6 +3455,10 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
|
|||||||
#define OB_XML_INSERT_FRAGMENT__USER_ERROR_MSG "Cannot insert XML fragments"
|
#define OB_XML_INSERT_FRAGMENT__USER_ERROR_MSG "Cannot insert XML fragments"
|
||||||
#define OB_ERR_NO_ORDER_MAP_SQL__USER_ERROR_MSG "cannot ORDER objects without MAP or ORDER method"
|
#define OB_ERR_NO_ORDER_MAP_SQL__USER_ERROR_MSG "cannot ORDER objects without MAP or ORDER method"
|
||||||
#define OB_ERR_XMLELEMENT_ALIASED__USER_ERROR_MSG "parameter 1 of function XMLELEMENT must be aliased"
|
#define OB_ERR_XMLELEMENT_ALIASED__USER_ERROR_MSG "parameter 1 of function XMLELEMENT must be aliased"
|
||||||
|
#define OB_INVALID_ALTERATIONG_DATATYPE__USER_ERROR_MSG "invalid alteration of datatype"
|
||||||
|
#define OB_INVALID_MODIFICATION_OF_COLUMNS__USER_ERROR_MSG "invalid modification of columns"
|
||||||
|
#define OB_ERR_NULL_FOR_XML_CONSTRUCTOR__USER_ERROR_MSG "Expected XML tag , got no content"
|
||||||
|
#define OB_ERR_XML_INDEX__USER_ERROR_MSG "cannot create index on expression with datatype ADT '%.*s'"
|
||||||
#define OB_SERVER_IS_INIT__USER_ERROR_MSG "Server is initializing"
|
#define OB_SERVER_IS_INIT__USER_ERROR_MSG "Server is initializing"
|
||||||
#define OB_SERVER_IS_STOPPING__USER_ERROR_MSG "Server is stopping"
|
#define OB_SERVER_IS_STOPPING__USER_ERROR_MSG "Server is stopping"
|
||||||
#define OB_PACKET_CHECKSUM_ERROR__USER_ERROR_MSG "Packet checksum error"
|
#define OB_PACKET_CHECKSUM_ERROR__USER_ERROR_MSG "Packet checksum error"
|
||||||
@ -5521,6 +5529,10 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
|
|||||||
#define OB_XML_INSERT_FRAGMENT__ORA_USER_ERROR_MSG "ORA-19010: Cannot insert XML fragments"
|
#define OB_XML_INSERT_FRAGMENT__ORA_USER_ERROR_MSG "ORA-19010: Cannot insert XML fragments"
|
||||||
#define OB_ERR_NO_ORDER_MAP_SQL__ORA_USER_ERROR_MSG "ORA-22950: cannot ORDER objects without MAP or ORDER method"
|
#define OB_ERR_NO_ORDER_MAP_SQL__ORA_USER_ERROR_MSG "ORA-22950: cannot ORDER objects without MAP or ORDER method"
|
||||||
#define OB_ERR_XMLELEMENT_ALIASED__ORA_USER_ERROR_MSG "ORA-19208: parameter 1 of function XMLELEMENT must be aliased"
|
#define OB_ERR_XMLELEMENT_ALIASED__ORA_USER_ERROR_MSG "ORA-19208: parameter 1 of function XMLELEMENT must be aliased"
|
||||||
|
#define OB_INVALID_ALTERATIONG_DATATYPE__ORA_USER_ERROR_MSG "ORA-22858: invalid alteration of datatype"
|
||||||
|
#define OB_INVALID_MODIFICATION_OF_COLUMNS__ORA_USER_ERROR_MSG "ORA-22859: invalid modification of columns"
|
||||||
|
#define OB_ERR_NULL_FOR_XML_CONSTRUCTOR__ORA_USER_ERROR_MSG "ORA-19032: Expected XML tag , got no content"
|
||||||
|
#define OB_ERR_XML_INDEX__ORA_USER_ERROR_MSG "ORA-02327: cannot create index on expression with datatype ADT '%.*s'"
|
||||||
#define OB_SERVER_IS_INIT__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -8001, Server is initializing"
|
#define OB_SERVER_IS_INIT__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -8001, Server is initializing"
|
||||||
#define OB_SERVER_IS_STOPPING__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -8002, Server is stopping"
|
#define OB_SERVER_IS_STOPPING__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -8002, Server is stopping"
|
||||||
#define OB_PACKET_CHECKSUM_ERROR__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -8003, Packet checksum error"
|
#define OB_PACKET_CHECKSUM_ERROR__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -8003, Packet checksum error"
|
||||||
@ -5877,7 +5889,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
|
|||||||
#define OB_ERR_DATA_TOO_LONG_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-12899: value too large for column %.*s (actual: %ld, maximum: %ld)"
|
#define OB_ERR_DATA_TOO_LONG_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-12899: value too large for column %.*s (actual: %ld, maximum: %ld)"
|
||||||
#define OB_ERR_INVALID_DATE_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-01861: Incorrect datetime value for column '%.*s' at row %ld"
|
#define OB_ERR_INVALID_DATE_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-01861: Incorrect datetime value for column '%.*s' at row %ld"
|
||||||
|
|
||||||
extern int g_all_ob_errnos[2066];
|
extern int g_all_ob_errnos[2070];
|
||||||
|
|
||||||
const char *ob_error_name(const int oberr);
|
const char *ob_error_name(const int oberr);
|
||||||
const char* ob_error_cause(const int oberr);
|
const char* ob_error_cause(const int oberr);
|
||||||
|
@ -356,6 +356,14 @@ int ObIndexBuilderUtil::set_index_table_columns(
|
|||||||
"column name", sort_item.column_name_,
|
"column name", sort_item.column_name_,
|
||||||
"column length", sort_item.prefix_len_, K(ret));
|
"column length", sort_item.prefix_len_, K(ret));
|
||||||
}
|
}
|
||||||
|
} else if (data_column->is_xmltype()) {
|
||||||
|
ret = OB_ERR_XML_INDEX;
|
||||||
|
LOG_USER_ERROR(OB_ERR_XML_INDEX, sort_item.column_name_.length(), sort_item.column_name_.ptr());
|
||||||
|
LOG_WARN("Index column should not be udt type", "tenant_id", data_schema.get_tenant_id(),
|
||||||
|
"database_id", data_schema.get_database_id(),
|
||||||
|
"table_name", data_schema.get_table_name(),
|
||||||
|
"column name", sort_item.column_name_,
|
||||||
|
"column length", sort_item.prefix_len_, K(ret));
|
||||||
} else if (ob_is_extend(data_column->get_data_type())
|
} else if (ob_is_extend(data_column->get_data_type())
|
||||||
|| ob_is_user_defined_sql_type(data_column->get_data_type())) {
|
|| ob_is_user_defined_sql_type(data_column->get_data_type())) {
|
||||||
ret = OB_ERR_WRONG_KEY_COLUMN;
|
ret = OB_ERR_WRONG_KEY_COLUMN;
|
||||||
|
@ -4008,6 +4008,14 @@ int ObTableSchema::check_alter_column_type(const ObColumnSchemaV2 &src_column,
|
|||||||
ret = OB_NOT_SUPPORTED;
|
ret = OB_NOT_SUPPORTED;
|
||||||
LOG_USER_ERROR(OB_NOT_SUPPORTED, "Alter non string type");
|
LOG_USER_ERROR(OB_NOT_SUPPORTED, "Alter non string type");
|
||||||
}
|
}
|
||||||
|
} else if (dst_column.is_xmltype()) {
|
||||||
|
// if xmltype, must be oracle mode
|
||||||
|
ret = OB_INVALID_ALTERATIONG_DATATYPE;
|
||||||
|
LOG_USER_ERROR(OB_INVALID_ALTERATIONG_DATATYPE);
|
||||||
|
} else if (src_column.is_xmltype()) {
|
||||||
|
// if xmltype, must be oracle mode
|
||||||
|
ret = OB_INVALID_MODIFICATION_OF_COLUMNS;
|
||||||
|
LOG_USER_ERROR(OB_INVALID_MODIFICATION_OF_COLUMNS);
|
||||||
} else if (!is_oracle_mode) {
|
} else if (!is_oracle_mode) {
|
||||||
is_offline = true;
|
is_offline = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2152,7 +2152,7 @@ int cast_not_expected(const sql::ObExpr &expr,
|
|||||||
sql::ObEvalCtx &ctx,
|
sql::ObEvalCtx &ctx,
|
||||||
sql::ObDatum &res_datum)
|
sql::ObDatum &res_datum)
|
||||||
{
|
{
|
||||||
int ret = OB_ERR_UNEXPECTED;
|
int ret = lib::is_oracle_mode() ? OB_ERR_INVALID_TYPE_FOR_OP : OB_ERR_UNEXPECTED;
|
||||||
UNUSED(ctx);
|
UNUSED(ctx);
|
||||||
UNUSED(res_datum);
|
UNUSED(res_datum);
|
||||||
ObObjType in_type = expr.args_[0]->datum_meta_.type_;
|
ObObjType in_type = expr.args_[0]->datum_meta_.type_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user