[CP] [to #44112459] fix serval pl/sql bugs

This commit is contained in:
obdev
2023-10-18 02:43:43 +00:00
committed by ob-robot
parent 983a0ad9dc
commit a8d994c61e
5 changed files with 24 additions and 23 deletions

View File

@ -7020,6 +7020,18 @@ int ObSPIService::get_result(ObPLExecCtx *ctx,
CK (OB_NOT_NULL(table = reinterpret_cast<ObPLCollection*>(result_address.get_ext())));
CK (OB_NOT_NULL(table));
OZ (bulk_tables.push_back(table));
#ifdef OB_BUILD_ORACLE_PL
if (OB_SUCC(ret) && table->is_varray()) {
ObPLVArray *varray = static_cast<ObPLVArray*>(table);
bool append_mode = (NULL == implicit_cursor ? false : implicit_cursor->get_in_forall());
int64_t new_count = append_mode ? table->get_count() + row_count : row_count;
CK (OB_NOT_NULL(varray));
if (OB_SUCC(ret) && new_count > varray->get_capacity()) {
ret = OB_ERR_SUBSCRIPT_OUTSIDE_LIMIT;
LOG_WARN("Subscript outside of limit", K(ret), K(append_mode), K(new_count), KPC(varray));
}
}
#endif
}
if (OB_SUCC(ret)) {
for (int64_t i = 0; OB_SUCC(ret) && i < bulk_tables.count(); ++i) {