!3688 with consistent snapshot需求添加B模式的限制

Merge pull request !3688 from 魏文韬/set_with_snapshot
This commit is contained in:
opengauss_bot
2023-07-13 06:08:32 +00:00
committed by Gitee
3 changed files with 16 additions and 0 deletions

View File

@ -19064,6 +19064,15 @@ TransactionStmt:
}
| START TRANSACTION WITH CONSISTENT SNAPSHOT
{
if (!DB_IS_CMPT(B_FORMAT)) {
const char* message = "WITH CONSISTENT SNAPSHOT is supported only in B-format database.";
InsertErrorMessage(message, u_sess->plsql_cxt.plpgsql_yylloc);
ereport(errstate,
(errmodule(MOD_PARSER),
errcode(ERRCODE_SYNTAX_ERROR),
errmsg("WITH CONSISTENT SNAPSHOT is supported only in B-format database."),
parser_errposition(@3)));
}
TransactionStmt *n = makeNode(TransactionStmt);
n->kind = TRANS_STMT_START;
n->options = NIL;

View File

@ -1,3 +1,5 @@
\c regression
start transaction with consistent snapshot;
create database with_snapshot_test dbcompatibility 'b';
\c with_snapshot_test;
set global transaction isolation level repeatable read;

View File

@ -1,3 +1,8 @@
\c regression
start transaction with consistent snapshot;
ERROR: WITH CONSISTENT SNAPSHOT is supported only in B-format database.
LINE 1: start transaction with consistent snapshot;
^
create database with_snapshot_test dbcompatibility 'b';
\c with_snapshot_test;
set global transaction isolation level repeatable read;