[master] fix pl autonomous transaction and pl cursor cases

This commit is contained in:
chinaxing
2023-01-28 18:32:41 +08:00
committed by ob-robot
parent 48159dd15d
commit 10b85bdc42
6 changed files with 42 additions and 20 deletions

View File

@ -812,6 +812,12 @@ int ObInnerSQLConnection::query(sqlclient::ObIExecutor &executor,
}
if (res.is_inited()) {
if (OB_SUCC(ret) && get_session().get_in_transaction()) {
if (ObStmt::is_dml_write_stmt(res.result_set().get_stmt_type()) ||
ObStmt::is_savepoint_stmt(res.result_set().get_stmt_type())) {
get_session().set_has_exec_inner_dml(true);
}
}
}
}
}
@ -1885,6 +1891,11 @@ int ObInnerSQLConnection::execute_write_inner(const uint64_t tenant_id, const Ob
LOG_WARN("failed to execute inner sql", K(ret));
} else if (FALSE_IT(affected_rows = handler->get_result()->get_affected_rows())) {
} else if (FALSE_IT(get_session().set_trans_type(transaction::ObTxClass::SYS))) {
} else if (get_session().get_in_transaction()) {
bool dml_or_savepoint =
ObStmt::is_dml_write_stmt(handler->get_result()->get_stmt_type())
|| ObStmt::is_savepoint_stmt(handler->get_result()->get_stmt_type());
get_session().set_has_exec_inner_dml(dml_or_savepoint);
}
if (OB_SUCC(ret)) {
if (OB_FAIL(res.close())) {