[CP] to issue<53024365>:fix date type pl var used by sql issue

This commit is contained in:
obdev
2024-02-09 01:58:08 +00:00
committed by ob-robot
parent 4875729e3b
commit 26979a9778
2 changed files with 10 additions and 1 deletions

View File

@ -3161,7 +3161,13 @@ do { \
sql::ObSqlExpression *default_expr = func_.get_default_expr(i);
OV (OB_NOT_NULL(default_expr), OB_ERR_UNEXPECTED, K(i), K(func_.get_default_idxs()));
OZ (ObSPIService::spi_calc_expr(&ctx_, default_expr, OB_INVALID_INDEX, &result));
if (OB_SUCC(ret) && result.is_null()) {
ObObjMeta null_meta = get_params().at(i).get_meta();
get_params().at(i).set_null();
get_params().at(i).set_null_meta(null_meta);
} else {
OX (get_params().at(i) = result);
}
if (pl_type.is_composite_type() && result.is_null()) {
OZ (init_complex_obj(
(*get_allocator()), func_.get_variables().at(i), get_params().at(i)));

View File

@ -930,6 +930,9 @@ int ObSPIService::spi_calc_expr(ObPLExecCtx *ctx,
} else if (result->get_accuracy() == invalid_accuracy) {
result->set_accuracy(ctx->params_->at(result_idx).get_accuracy());
}
if (result->is_null()) {
result->set_null_meta(param.get_null_meta());
}
if (has_lob_header) {
result->ObObj::set_has_lob_header();
}