pgsql: Fix small memory leak in ecpglib ecpg_update_declare_statement()

2019-07-07 Thread Michael Meskes
Fix small memory leak in ecpglib ecpg_update_declare_statement() is called the second time. Author: "Zhang, Jie" Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/58006f8041fffc9260b92fc2cb3a571aaa6c6d22 Modified Files -- src/interfaces/ecpg/ecpgl

pgsql: Fix inconsistencies in the code

2019-07-07 Thread Michael Paquier
Fix inconsistencies in the code This addresses a couple of issues in the code: - Typos and inconsistencies in comments and function declarations. - Removal of unreferenced function declarations. - Removal of unnecessary compile flags. - A cleanup error in regressplans.sh. Author: Alexander Lakhin

pgsql: Add missing assertions for required table am callbacks.

2019-07-07 Thread Amit Kapila
Add missing assertions for required table am callbacks. Reported-by: Ashwin Agrawal Author: Ashwin Agrawal Reviewed-by: Amit Kapila Backpatch-through: 12, where it was introduced Discussion: https://postgr.es/m/calfoeisgdzhydrjoukabzvxfjok2fq0szvmk7dzmcy6w93i...@mail.gmail.com Branch -- REL_

pgsql: Add missing assertions for required table am callbacks.

2019-07-07 Thread Amit Kapila
Add missing assertions for required table am callbacks. Reported-by: Ashwin Agrawal Author: Ashwin Agrawal Reviewed-by: Amit Kapila Backpatch-through: 12, where it was introduced Discussion: https://postgr.es/m/calfoeisgdzhydrjoukabzvxfjok2fq0szvmk7dzmcy6w93i...@mail.gmail.com Branch -- mast

pgsql: In pg_log_generic(), be more paranoid about preserving errno.

2019-07-07 Thread Tom Lane
In pg_log_generic(), be more paranoid about preserving errno. This code failed to account for the possibility that malloc() would change errno, resulting in wrong output for %m, not to mention the possibility of message truncation. Such a change is obviously expected when malloc fails, but there'

pgsql: In pg_log_generic(), be more paranoid about preserving errno.

2019-07-07 Thread Tom Lane
In pg_log_generic(), be more paranoid about preserving errno. This code failed to account for the possibility that malloc() would change errno, resulting in wrong output for %m, not to mention the possibility of message truncation. Such a change is obviously expected when malloc fails, but there'

pgsql: Use consistent style for checking return from system calls

2019-07-07 Thread Peter Eisentraut
Use consistent style for checking return from system calls Use if (something() != 0) error ... instead of just if (something) error ... The latter is not incorrect, but it's a bit confusing and not the common style. Discussion: https://www.postgresql.org/message-id/fl