]> granicus.if.org Git - postgresql/commit
reorderbuffer: preserve errno while reporting error
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 19 Aug 2016 17:38:55 +0000 (14:38 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 19 Aug 2016 17:38:55 +0000 (14:38 -0300)
commit0440f49523fb88a3ecbc1672d8fcee20197c5c40
tree26599b318c107ecd4c22ce760977330f618a34e4
parent2b4ae9c29d42ce7b1b7bb947c585b78a21535aa2
reorderbuffer: preserve errno while reporting error

Clobbering errno during cleanup after an error is an oft-repeated, easy
to make mistake.  Deal with it here as everywhere else, by saving it
aside and restoring after cleanup, before ereport'ing.

In passing, add a missing errcode declaration in another ereport() call
in the same file, which I noticed while skimming the file looking for
similar problems.

Backpatch to 9.4, where this code was introduced.
src/backend/replication/logical/reorderbuffer.c