Skip to content

Commit

Permalink
Turn the previous user-visible errors into internal ones
Browse files Browse the repository at this point in the history
  • Loading branch information
johto committed Jul 26, 2014
1 parent a23499c commit 1acab6f
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/pl/plpgsql/src/pl_exec.c
Expand Up @@ -2939,10 +2939,9 @@ exec_stmt_raise(PLpgSQL_execstate *estate, PLpgSQL_stmt_raise *stmt)
continue;
}

/* should have been checked by the compiler */
if (current_param == NULL)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("too few parameters specified for RAISE")));
elog(ERROR, "unexpected RAISE parameter list length");

paramvalue = exec_eval_expr(estate,
(PLpgSQL_expr *) lfirst(current_param),
Expand All @@ -2963,14 +2962,9 @@ exec_stmt_raise(PLpgSQL_execstate *estate, PLpgSQL_stmt_raise *stmt)
appendStringInfoChar(&ds, cp[0]);
}

/*
* If more parameters were specified than were required to process the
* format string, throw an error
*/
/* should have been checked by the compiler */
if (current_param != NULL)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("too many parameters specified for RAISE")));
elog(ERROR, "unexpected RAISE parameter list length");

err_message = ds.data;
/* No pfree(ds.data), the pfree(err_message) does it */
Expand Down

0 comments on commit 1acab6f

Please sign in to comment.