mirror of
https://github.com/postgres/postgres.git
synced 2025-12-10 14:22:35 +03:00
Revert MERGE patch
This reverts commitsd204ef6377,83454e3c2band a few more commits thereafter (complete list at the end) related to MERGE feature. While the feature was fully functional, with sufficient test coverage and necessary documentation, it was felt that some parts of the executor and parse-analyzer can use a different design and it wasn't possible to do that in the available time. So it was decided to revert the patch for PG11 and retry again in the future. Thanks again to all reviewers and bug reporters. List of commits reverted, in reverse chronological order:f1464c5380Improve parse representation for MERGEddb4158579MERGE syntax diagram correction530e69e59bAllow cpluspluscheck to pass by renaming variable01b88b4df5MERGE minor errata3af7b2b0d4MERGE fix variable warning in non-assert buildsa5d86181ecMERGE INSERT allows only one VALUES clause4b2d44031fMERGE post-commit review4923550c20Tab completion for MERGEaa3faa3c7aWITH support in MERGE83454e3c2bNew files for MERGEd204ef6377MERGE SQL Command following SQL:2016 Author: Pavan Deolasee Reviewed-by: Michael Paquier
This commit is contained in:
@@ -3995,7 +3995,7 @@ exec_stmt_execsql(PLpgSQL_execstate *estate,
|
||||
|
||||
/*
|
||||
* On the first call for this statement generate the plan, and detect
|
||||
* whether the statement is INSERT/UPDATE/DELETE/MERGE
|
||||
* whether the statement is INSERT/UPDATE/DELETE
|
||||
*/
|
||||
if (expr->plan == NULL)
|
||||
{
|
||||
@@ -4016,7 +4016,6 @@ exec_stmt_execsql(PLpgSQL_execstate *estate,
|
||||
{
|
||||
if (q->commandType == CMD_INSERT ||
|
||||
q->commandType == CMD_UPDATE ||
|
||||
q->commandType == CMD_MERGE ||
|
||||
q->commandType == CMD_DELETE)
|
||||
stmt->mod_stmt = true;
|
||||
}
|
||||
@@ -4074,7 +4073,6 @@ exec_stmt_execsql(PLpgSQL_execstate *estate,
|
||||
case SPI_OK_INSERT_RETURNING:
|
||||
case SPI_OK_UPDATE_RETURNING:
|
||||
case SPI_OK_DELETE_RETURNING:
|
||||
case SPI_OK_MERGE:
|
||||
Assert(stmt->mod_stmt);
|
||||
exec_set_found(estate, (SPI_processed != 0));
|
||||
break;
|
||||
@@ -4252,7 +4250,6 @@ exec_stmt_dynexecute(PLpgSQL_execstate *estate,
|
||||
case SPI_OK_INSERT_RETURNING:
|
||||
case SPI_OK_UPDATE_RETURNING:
|
||||
case SPI_OK_DELETE_RETURNING:
|
||||
case SPI_OK_MERGE:
|
||||
case SPI_OK_UTILITY:
|
||||
case SPI_OK_REWRITTEN:
|
||||
break;
|
||||
|
||||
@@ -304,7 +304,6 @@ static void check_raise_parameters(PLpgSQL_stmt_raise *stmt);
|
||||
%token <keyword> K_LAST
|
||||
%token <keyword> K_LOG
|
||||
%token <keyword> K_LOOP
|
||||
%token <keyword> K_MERGE
|
||||
%token <keyword> K_MESSAGE
|
||||
%token <keyword> K_MESSAGE_TEXT
|
||||
%token <keyword> K_MOVE
|
||||
@@ -1952,10 +1951,6 @@ stmt_execsql : K_IMPORT
|
||||
{
|
||||
$$ = make_execsql_stmt(K_INSERT, @1);
|
||||
}
|
||||
| K_MERGE
|
||||
{
|
||||
$$ = make_execsql_stmt(K_MERGE, @1);
|
||||
}
|
||||
| T_WORD
|
||||
{
|
||||
int tok;
|
||||
@@ -2502,7 +2497,6 @@ unreserved_keyword :
|
||||
| K_IS
|
||||
| K_LAST
|
||||
| K_LOG
|
||||
| K_MERGE
|
||||
| K_MESSAGE
|
||||
| K_MESSAGE_TEXT
|
||||
| K_MOVE
|
||||
@@ -2966,8 +2960,6 @@ make_execsql_stmt(int firsttoken, int location)
|
||||
{
|
||||
if (prev_tok == K_INSERT)
|
||||
continue; /* INSERT INTO is not an INTO-target */
|
||||
if (prev_tok == K_MERGE)
|
||||
continue; /* MERGE INTO is not an INTO-target */
|
||||
if (firsttoken == K_IMPORT)
|
||||
continue; /* IMPORT ... INTO is not an INTO-target */
|
||||
if (have_into)
|
||||
|
||||
@@ -138,7 +138,6 @@ static const ScanKeyword unreserved_keywords[] = {
|
||||
PG_KEYWORD("is", K_IS, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("last", K_LAST, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("log", K_LOG, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("merge", K_MERGE, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("message", K_MESSAGE, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("message_text", K_MESSAGE_TEXT, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("move", K_MOVE, UNRESERVED_KEYWORD)
|
||||
|
||||
@@ -857,8 +857,8 @@ typedef struct PLpgSQL_stmt_execsql
|
||||
PLpgSQL_stmt_type cmd_type;
|
||||
int lineno;
|
||||
PLpgSQL_expr *sqlstmt;
|
||||
bool mod_stmt; /* is the stmt INSERT/UPDATE/DELETE/MERGE?
|
||||
* Note mod_stmt is set when we plan the query */
|
||||
bool mod_stmt; /* is the stmt INSERT/UPDATE/DELETE? Note:
|
||||
* mod_stmt is set when we plan the query */
|
||||
bool into; /* INTO supplied? */
|
||||
bool strict; /* INTO STRICT flag */
|
||||
PLpgSQL_variable *target; /* INTO target (record or row) */
|
||||
|
||||
Reference in New Issue
Block a user