diff options
| author | Simon Riggs | 2018-04-12 10:22:56 +0000 |
|---|---|---|
| committer | Simon Riggs | 2018-04-12 10:22:56 +0000 |
| commit | 08ea7a2291db21a618d19d612c8060cda68f1892 (patch) | |
| tree | 4d10675439742c7206e089bd21e793332562ae83 /src/pl | |
| parent | c9c875a28fa6cbc38c227fb9e656dd7be948166f (diff) | |
Revert MERGE patch
This reverts commits d204ef63776b8a00ca220adec23979091564e465,
83454e3c2b28141c0db01c7d2027e01040df5249 and 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:
f1464c5380 Improve parse representation for MERGE
ddb4158579 MERGE syntax diagram correction
530e69e59b Allow cpluspluscheck to pass by renaming variable
01b88b4df5 MERGE minor errata
3af7b2b0d4 MERGE fix variable warning in non-assert builds
a5d86181ec MERGE INSERT allows only one VALUES clause
4b2d44031f MERGE post-commit review
4923550c20 Tab completion for MERGE
aa3faa3c7a WITH support in MERGE
83454e3c2b New files for MERGE
d204ef6377 MERGE SQL Command following SQL:2016
Author: Pavan Deolasee
Reviewed-by: Michael Paquier
Diffstat (limited to 'src/pl')
| -rw-r--r-- | src/pl/plpgsql/src/pl_exec.c | 5 | ||||
| -rw-r--r-- | src/pl/plpgsql/src/pl_gram.y | 8 | ||||
| -rw-r--r-- | src/pl/plpgsql/src/pl_scanner.c | 1 | ||||
| -rw-r--r-- | src/pl/plpgsql/src/plpgsql.h | 4 |
4 files changed, 3 insertions, 15 deletions
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 4b6f51ac98..99f167a0a8 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -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; diff --git a/src/pl/plpgsql/src/pl_gram.y b/src/pl/plpgsql/src/pl_gram.y index f9ba19cbdf..b59869a534 100644 --- a/src/pl/plpgsql/src/pl_gram.y +++ b/src/pl/plpgsql/src/pl_gram.y @@ -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) diff --git a/src/pl/plpgsql/src/pl_scanner.c b/src/pl/plpgsql/src/pl_scanner.c index 256fc0a243..fc4ba3054a 100644 --- a/src/pl/plpgsql/src/pl_scanner.c +++ b/src/pl/plpgsql/src/pl_scanner.c @@ -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) diff --git a/src/pl/plpgsql/src/plpgsql.h b/src/pl/plpgsql/src/plpgsql.h index 8d30180d42..fe617791df 100644 --- a/src/pl/plpgsql/src/plpgsql.h +++ b/src/pl/plpgsql/src/plpgsql.h @@ -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) */ |
