diff options
| author | Tom Lane | 2015-08-18 23:22:37 +0000 |
|---|---|---|
| committer | Tom Lane | 2015-08-18 23:22:37 +0000 |
| commit | 2edb9491155ad70e57b5d18f2aa0d8d5a09386cd (patch) | |
| tree | 1f28b406ada01e6614df4059d46e5957aa20c1d8 /src/pl | |
| parent | db5a703bf69d6302d0d515a9068baebffd2d227e (diff) | |
Fix a few bogus statement type names in plpgsql error messages.
plpgsql's error location context messages ("PL/pgSQL function fn-name line
line-no at stmt-type") would misreport a CONTINUE statement as being an
EXIT, and misreport a MOVE statement as being a FETCH. These are clear
bugs that have been there a long time, so back-patch to all supported
branches.
In addition, in 9.5 and HEAD, change the description of EXECUTE from
"EXECUTE statement" to just plain EXECUTE; there seems no good reason why
this statement type should be described differently from others that have
a well-defined head keyword. And distinguish GET STACKED DIAGNOSTICS from
plain GET DIAGNOSTICS. These are a bit more of a judgment call, and also
affect existing regression-test outputs, so I did not back-patch into
stable branches.
Pavel Stehule and Tom Lane
Diffstat (limited to 'src/pl')
| -rw-r--r-- | src/pl/plpgsql/src/pl_funcs.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/pl/plpgsql/src/pl_funcs.c b/src/pl/plpgsql/src/pl_funcs.c index 7b26970f46..900ba3c13b 100644 --- a/src/pl/plpgsql/src/pl_funcs.c +++ b/src/pl/plpgsql/src/pl_funcs.c @@ -235,7 +235,7 @@ plpgsql_stmt_typename(PLpgSQL_stmt *stmt) case PLPGSQL_STMT_FOREACH_A: return _("FOREACH over array"); case PLPGSQL_STMT_EXIT: - return "EXIT"; + return ((PLpgSQL_stmt_exit *) stmt)->is_exit ? "EXIT" : "CONTINUE"; case PLPGSQL_STMT_RETURN: return "RETURN"; case PLPGSQL_STMT_RETURN_NEXT: @@ -249,15 +249,16 @@ plpgsql_stmt_typename(PLpgSQL_stmt *stmt) case PLPGSQL_STMT_EXECSQL: return _("SQL statement"); case PLPGSQL_STMT_DYNEXECUTE: - return _("EXECUTE statement"); + return "EXECUTE"; case PLPGSQL_STMT_DYNFORS: return _("FOR over EXECUTE statement"); case PLPGSQL_STMT_GETDIAG: - return "GET DIAGNOSTICS"; + return ((PLpgSQL_stmt_getdiag *) stmt)->is_stacked ? + "GET STACKED DIAGNOSTICS" : "GET DIAGNOSTICS"; case PLPGSQL_STMT_OPEN: return "OPEN"; case PLPGSQL_STMT_FETCH: - return "FETCH"; + return ((PLpgSQL_stmt_fetch *) stmt)->is_move ? "MOVE" : "FETCH"; case PLPGSQL_STMT_CLOSE: return "CLOSE"; case PLPGSQL_STMT_PERFORM: |
