Repair an error introduced by log_line_prefix patch: it is not acceptable
to assume that the string pointer passed to set_ps_display is good forever. There's no need to anyway since ps_status.c itself saves the string, and we already had an API (get_ps_display) to return it. I believe this explains Jim Nasby's report of intermittent crashes in elog.c when %i format code is in use in log_line_prefix. While at it, repair a previously unnoticed problem: on some platforms such as Darwin, the string returned by get_ps_display was blank-padded to the maximum length, meaning that lock.c's attempt to append " waiting" to it never worked.
Showing
- src/backend/postmaster/postmaster.c 1 addition, 2 deletionssrc/backend/postmaster/postmaster.c
- src/backend/storage/lmgr/lock.c 7 additions, 8 deletionssrc/backend/storage/lmgr/lock.c
- src/backend/utils/error/elog.c 13 additions, 5 deletionssrc/backend/utils/error/elog.c
- src/backend/utils/misc/ps_status.c 19 additions, 7 deletionssrc/backend/utils/misc/ps_status.c
- src/include/libpq/libpq-be.h 1 addition, 2 deletionssrc/include/libpq/libpq-be.h
- src/include/utils/ps_status.h 2 additions, 2 deletionssrc/include/utils/ps_status.h
Loading
Please register or sign in to comment