-
由 Heikki Linnakangas 提交于
It was somewhat broken. The order of evaluation of function arguments is implementation-specific, so in a statement like: ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errOmitLocation(true))); We cannot assume that errOmitLocation() is evaluated after errcode(). If errOmitLocation() is evaluated first, the errcode() call could overwrite the omit_location field, seeing that the error code was "internal error". Almost all of the errOmitLocation calls in the codebase were superfluous anyway. The default logic is to omit the location for anything else than ERRCODE_INTERNAL error, so it is not necessary to call errOmitLocation(true), if errcode (other than ERRCODE_INTERNAL_ERROR) is given. Likewise errOmitLocation(false) is not needed for internal errors. Remove the whole errOmitLocation() function. It's not really needed. The most notable callsite where it mattered was in cdbdisp.c, but that one was broken by the order-of-evaluation issue. Use a different error code there. What we really should do there is to pass the error code from the segment back to the client, but I'll leave that for another day.
f6f5c9ef