Unify ABORT and ROLLBACK command parsing

Remove separate early-return handling for ABORT that was bypassing parse_rollback(). Treat ABORT as a synonym of ROLLBACK.
v3.0_pgsql-pipeline-set-reset-discard-fix-5432
Rahim Kanji 1 month ago
parent abb66cc19f
commit 5810978e4e

@ -391,14 +391,12 @@ TxnCmd PgSQL_TxnCmdParser::parse(std::string_view input) noexcept {
cmd_type = TxnCmd::SAVEPOINT;
} else if (iequals(first_word, "release")) {
cmd_type = TxnCmd::RELEASE;
} else if (iequals(first_word, "rollback")) {
} else if (iequals(first_word, "rollback") || iequals(first_word, "abort")) {
// ABORT is a synonym for ROLLBACK (including ABORT AND CHAIN = ROLLBACK AND CHAIN)
cmd_type = TxnCmd::ROLLBACK;
} else if (iequals(first_word, "commit") || iequals(first_word, "end")) {
cmd.type = TxnCmd::COMMIT;
return cmd;
} else if (iequals(first_word, "abort")) {
cmd.type = TxnCmd::ROLLBACK;
return cmd;
}
// If not a transaction command, return early

Loading…
Cancel
Save