mirror of
https://github.com/postgres/postgres.git
synced 2025-05-11 05:41:32 +03:00
Fix behavior when raising plpy.Fatal()
It should cause a elog(FATAL) error, and it fact it was simply causing a elog(ERROR). Jan Urbański
This commit is contained in:
parent
8f76324352
commit
804d13adfd
@ -4381,8 +4381,13 @@ PLy_elog(int elevel, const char *fmt,...)
|
|||||||
int position = 0;
|
int position = 0;
|
||||||
|
|
||||||
PyErr_Fetch(&exc, &val, &tb);
|
PyErr_Fetch(&exc, &val, &tb);
|
||||||
if (exc != NULL && PyErr_GivenExceptionMatches(val, PLy_exc_spi_error))
|
if (exc != NULL)
|
||||||
PLy_get_spi_error_data(val, &detail, &hint, &query, &position);
|
{
|
||||||
|
if (PyErr_GivenExceptionMatches(val, PLy_exc_spi_error))
|
||||||
|
PLy_get_spi_error_data(val, &detail, &hint, &query, &position);
|
||||||
|
else if (PyErr_GivenExceptionMatches(val, PLy_exc_fatal))
|
||||||
|
elevel = FATAL;
|
||||||
|
}
|
||||||
PyErr_Restore(exc, val, tb);
|
PyErr_Restore(exc, val, tb);
|
||||||
|
|
||||||
xmsg = PLy_traceback(&xlevel);
|
xmsg = PLy_traceback(&xlevel);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user