fix bug: update set should report error when charset convert error

This commit is contained in:
akaError
2023-09-13 07:10:33 +00:00
committed by ob-robot
parent 8e28a65afa
commit e4415822c8
4 changed files with 17 additions and 17 deletions

View File

@ -284,18 +284,9 @@ int ObExprColumnConv::calc_result_typeN(ObExprResType &type,
ret = OB_ERR_INVALID_TYPE_FOR_OP;
LOG_WARN("inconsistent datatypes", "expected", type_tc, "got", value_tc);
} else {
bool is_ddl = const_cast<sql::ObSQLSessionInfo *>(type_ctx.get_session())->get_ddl_info().is_ddl();
type_ctx.set_cast_mode(type_ctx.get_cast_mode() |
type_ctx.get_raw_expr()->get_extra() |
CM_COLUMN_CONVERT);
if (!is_ddl) {
bool is_strict = is_strict_mode(type_ctx.get_session()->get_sql_mode());
if (lib::is_mysql_mode() && is_strict) {
//do nothing
} else {
type_ctx.set_cast_mode(type_ctx.get_cast_mode() | CM_CHARSET_CONVERT_IGNORE_ERR);
}
}
type_ctx.get_raw_expr()->get_extra() |
CM_COLUMN_CONVERT);
types[4].set_calc_meta(type);
}
}