修复错误语句处理不一致的问题
This commit is contained in:
@ -4564,8 +4564,12 @@ void AbortCurrentTransaction(bool STP_rollback)
|
||||
case TBLOCK_STARTED:
|
||||
AbortTransaction(PerfectRollback, STP_rollback);
|
||||
ApplyUndoActions();
|
||||
if (u_sess->attr.attr_storage.phony_autocommit || STP_rollback) {
|
||||
CleanupTransaction();
|
||||
s->blockState = TBLOCK_DEFAULT;
|
||||
} else {
|
||||
s->blockState = TBLOCK_ABORT;
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
|
@ -255,6 +255,16 @@ SHOW autocommit;
|
||||
on
|
||||
(1 row)
|
||||
|
||||
-- error in transaction block
|
||||
SET autocommit = 0;
|
||||
CREATE;
|
||||
ERROR: syntax error at or near ";"
|
||||
LINE 1: CREATE;
|
||||
^
|
||||
SET autocommit = 1;
|
||||
ERROR: current transaction is aborted, commands ignored until end of transaction block, firstChar[Q]
|
||||
ROLLBACK;
|
||||
SET autocommit = 1;
|
||||
\c regression
|
||||
DROP DATABASE test_db;
|
||||
DROP DATABASE test_drop;
|
||||
|
@ -124,6 +124,13 @@ ROLLBACK;
|
||||
SELECT * FROM test_table;
|
||||
SHOW autocommit;
|
||||
|
||||
-- error in transaction block
|
||||
SET autocommit = 0;
|
||||
CREATE;
|
||||
SET autocommit = 1;
|
||||
ROLLBACK;
|
||||
SET autocommit = 1;
|
||||
|
||||
\c regression
|
||||
DROP DATABASE test_db;
|
||||
DROP DATABASE test_drop;
|
||||
|
Reference in New Issue
Block a user