[CP] sync bugfix json->year cast on not null constraint
This commit is contained in:
parent
70d9cc1e8f
commit
226981c115
@ -8844,7 +8844,12 @@ static int json_year(const ObObjType expect_type, ObObjCastParams ¶ms,
|
||||
LOG_WARN("fail to cast json int to year type", K(ret), K(int_value), K(expect_type));
|
||||
} else {
|
||||
if (lib::is_mysql_mode() && (params.warning_ == OB_DATA_OUT_OF_RANGE)) {
|
||||
out.set_null(); // not change the behavior of int_year
|
||||
if (CM_IS_WARN_ON_FAIL(cast_mode)) {
|
||||
value = 0;
|
||||
SET_RES_YEAR(out);
|
||||
} else {
|
||||
out.set_null(); // not change the behavior of int_year
|
||||
}
|
||||
} else {
|
||||
SET_RES_YEAR(out);
|
||||
}
|
||||
|
@ -8788,7 +8788,12 @@ CAST_FUNC_NAME(json, year)
|
||||
LOG_WARN("fail to cast json int to year type", K(ret), K(int_val));
|
||||
} else {
|
||||
if (lib::is_mysql_mode() && (warning == OB_DATA_OUT_OF_RANGE)) {
|
||||
res_datum.set_null(); // not change the behavior of int_year
|
||||
if (CM_IS_WARN_ON_FAIL(expr.extra_)) {
|
||||
out_val = 0;
|
||||
SET_RES_YEAR(out_val);
|
||||
} else {
|
||||
res_datum.set_null(); // not change the behavior of int_year
|
||||
}
|
||||
} else {
|
||||
SET_RES_YEAR(out_val);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user