!186 Fix select-for-update validation when pre_abort_validation is set to off

Merge pull request !186 from Vinoth Veeraraghavan/master
This commit is contained in:
opengauss-bot
2020-09-04 17:17:40 +08:00
committed by Gitee

View File

@ -264,13 +264,7 @@ RC OccTransactionManager::ValidateOcc(TxnManager* txMan)
m_writeSetSize++;
break;
case RD:
if (txMan->GetTxnIsoLevel() > READ_COMMITED) {
readSetSize++;
if (m_preAbort && !QuickVersionCheck(ac)) {
rc = RC_ABORT;
goto final;
}
}
readSetSize++;
break;
default:
break;
@ -291,8 +285,7 @@ RC OccTransactionManager::ValidateOcc(TxnManager* txMan)
}
// validate rows in the read set and write set
// for repeatable_read, no need to validate the read set.
if (txMan->GetTxnIsoLevel() > READ_COMMITED) {
if (readSetSize > 0) {
if (!ValidateReadSet(txMan)) {
rc = RC_ABORT;
goto final;