pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix assorted small bugs in ThrowErrorData(). 3+ messages / 1 participants [nested] [flat]
* pgsql: Fix assorted small bugs in ThrowErrorData(). @ 2016-08-26 18:19 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2016-08-26 18:19 UTC (permalink / raw) To: pgsql-committers Fix assorted small bugs in ThrowErrorData(). Copy the palloc'd strings into the correct context, ie ErrorContext not wherever the source ErrorData is. This would be a large bug, except that it appears that all catchers of thrown errors do either EmitErrorReport or CopyErrorData before doing anything that would cause transient memory contexts to be cleaned up. Still, it's wrong and it will bite somebody someday. Fix failure to copy cursorpos and internalpos. Utter the appropriate incantations involving recursion_depth, so that we'll behave sanely if we get an error inside pstrdup. (In general, the body of this function ought to act like, eg, errdetail().) Per code reading induced by Jakob Egger's report. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/8529036b53298c0555670b4a81ed7349c44aeeb4 Modified Files -------------- src/backend/utils/error/elog.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix assorted small bugs in ThrowErrorData(). @ 2016-08-26 18:19 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2016-08-26 18:19 UTC (permalink / raw) To: pgsql-committers Fix assorted small bugs in ThrowErrorData(). Copy the palloc'd strings into the correct context, ie ErrorContext not wherever the source ErrorData is. This would be a large bug, except that it appears that all catchers of thrown errors do either EmitErrorReport or CopyErrorData before doing anything that would cause transient memory contexts to be cleaned up. Still, it's wrong and it will bite somebody someday. Fix failure to copy cursorpos and internalpos. Utter the appropriate incantations involving recursion_depth, so that we'll behave sanely if we get an error inside pstrdup. (In general, the body of this function ought to act like, eg, errdetail().) Per code reading induced by Jakob Egger's report. Branch ------ REL9_6_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/6e47c6cf7de30b9f6a6b31eb7d4af80039a16920 Modified Files -------------- src/backend/utils/error/elog.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix assorted small bugs in ThrowErrorData(). @ 2016-08-26 18:19 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2016-08-26 18:19 UTC (permalink / raw) To: pgsql-committers Fix assorted small bugs in ThrowErrorData(). Copy the palloc'd strings into the correct context, ie ErrorContext not wherever the source ErrorData is. This would be a large bug, except that it appears that all catchers of thrown errors do either EmitErrorReport or CopyErrorData before doing anything that would cause transient memory contexts to be cleaned up. Still, it's wrong and it will bite somebody someday. Fix failure to copy cursorpos and internalpos. Utter the appropriate incantations involving recursion_depth, so that we'll behave sanely if we get an error inside pstrdup. (In general, the body of this function ought to act like, eg, errdetail().) Per code reading induced by Jakob Egger's report. Branch ------ REL9_5_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/51b5008c7fdbdc762ce2103c1d907278c0882909 Modified Files -------------- src/backend/utils/error/elog.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2016-08-26 18:19 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2016-08-26 18:19 pgsql: Fix assorted small bugs in ThrowErrorData(). Tom Lane <tgl@sss.pgh.pa.us> 2016-08-26 18:19 pgsql: Fix assorted small bugs in ThrowErrorData(). Tom Lane <tgl@sss.pgh.pa.us> 2016-08-26 18:19 pgsql: Fix assorted small bugs in ThrowErrorData(). Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox