-
- Downloads
Fix a number of places that produced XX000 errors in the regression tests.
It's against project policy to use elog() for user-facing errors, or to omit an errcode() selection for errors that aren't supposed to be "can't happen" cases. Fix all the violations of this policy that result in ERRCODE_INTERNAL_ERROR log entries during the standard regression tests, as errors that can reliably be triggered from SQL surely should be considered user-facing. I also looked through all the files touched by this commit and fixed other nearby problems of the same ilk. I do not claim to have fixed all violations of the policy, just the ones in these files. In a few places I also changed existing ERRCODE choices that didn't seem particularly appropriate; mainly replacing ERRCODE_SYNTAX_ERROR by something more specific. Back-patch to 9.5, but no further; changing ERRCODE assignments in stable branches doesn't seem like a good idea.
Showing
- contrib/tablefunc/tablefunc.c 25 additions, 15 deletionscontrib/tablefunc/tablefunc.c
- src/backend/access/common/reloptions.c 12 additions, 7 deletionssrc/backend/access/common/reloptions.c
- src/backend/access/heap/heapam.c 6 additions, 2 deletionssrc/backend/access/heap/heapam.c
- src/backend/commands/copy.c 21 additions, 11 deletionssrc/backend/commands/copy.c
- src/backend/commands/vacuum.c 4 additions, 1 deletionsrc/backend/commands/vacuum.c
- src/backend/executor/execQual.c 4 additions, 2 deletionssrc/backend/executor/execQual.c
- src/backend/utils/adt/txid.c 9 additions, 4 deletionssrc/backend/utils/adt/txid.c
- src/pl/plperl/plperl.c 47 additions, 23 deletionssrc/pl/plperl/plperl.c
- src/pl/plpython/plpy_elog.c 1 addition, 1 deletionsrc/pl/plpython/plpy_elog.c
- src/pl/plpython/plpy_exec.c 8 additions, 4 deletionssrc/pl/plpython/plpy_exec.c
- src/pl/tcl/pltcl.c 35 additions, 16 deletionssrc/pl/tcl/pltcl.c
- src/test/regress/expected/txid.out 5 additions, 5 deletionssrc/test/regress/expected/txid.out
- src/test/regress/regress.c 4 additions, 2 deletionssrc/test/regress/regress.c
Loading
Please register or sign in to comment