pgsql: Fix assign_record_type_typmod().

2021-07-10 Thread Jeff Davis
Fix assign_record_type_typmod(). If an error occurred in the wrong place, it was possible to leave an unintialized entry in the hash table, leading to a crash. Fixed. Also, be more careful about the order of operations so that an allocation error doesn't leak memory in CacheMemoryContext or

pgsql: Fix assign_record_type_typmod().

2021-07-10 Thread Jeff Davis
Fix assign_record_type_typmod(). If an error occurred in the wrong place, it was possible to leave an unintialized entry in the hash table, leading to a crash. Fixed. Also, be more careful about the order of operations so that an allocation error doesn't leak memory in CacheMemoryContext or

pgsql: Fix assign_record_type_typmod().

2021-07-10 Thread Jeff Davis
Fix assign_record_type_typmod(). If an error occurred in the wrong place, it was possible to leave an unintialized entry in the hash table, leading to a crash. Fixed. Also, be more careful about the order of operations so that an allocation error doesn't leak memory in CacheMemoryContext or

pgsql: Fix assign_record_type_typmod().

2021-07-10 Thread Jeff Davis
Fix assign_record_type_typmod(). If an error occurred in the wrong place, it was possible to leave an unintialized entry in the hash table, leading to a crash. Fixed. Also, be more careful about the order of operations so that an allocation error doesn't leak memory in CacheMemoryContext or

pgsql: Fix assign_record_type_typmod().

2021-07-10 Thread Jeff Davis
Fix assign_record_type_typmod(). If an error occurred in the wrong place, it was possible to leave an unintialized entry in the hash table, leading to a crash. Fixed. Also, be more careful about the order of operations so that an allocation error doesn't leak memory in CacheMemoryContext or

pgsql: Fix busted test for ldap_initialize.

2021-07-10 Thread Tom Lane
Fix busted test for ldap_initialize. Sigh ... I was expecting AC_CHECK_LIB to do something it didn't, namely update LIBS. This led to not finding ldap_initialize. Fix by moving the probe for ldap_initialize. In some sense this is more correct anyway, since (at least for now) we care about

pgsql: Fix busted test for ldap_initialize.

2021-07-10 Thread Tom Lane
Fix busted test for ldap_initialize. Sigh ... I was expecting AC_CHECK_LIB to do something it didn't, namely update LIBS. This led to not finding ldap_initialize. Fix by moving the probe for ldap_initialize. In some sense this is more correct anyway, since (at least for now) we care about

pgsql: Fix busted test for ldap_initialize.

2021-07-10 Thread Tom Lane
Fix busted test for ldap_initialize. Sigh ... I was expecting AC_CHECK_LIB to do something it didn't, namely update LIBS. This led to not finding ldap_initialize. Fix by moving the probe for ldap_initialize. In some sense this is more correct anyway, since (at least for now) we care about

pgsql: Fix busted test for ldap_initialize.

2021-07-10 Thread Tom Lane
Fix busted test for ldap_initialize. Sigh ... I was expecting AC_CHECK_LIB to do something it didn't, namely update LIBS. This led to not finding ldap_initialize. Fix by moving the probe for ldap_initialize. In some sense this is more correct anyway, since (at least for now) we care about

pgsql: Fix busted test for ldap_initialize.

2021-07-10 Thread Tom Lane
Fix busted test for ldap_initialize. Sigh ... I was expecting AC_CHECK_LIB to do something it didn't, namely update LIBS. This led to not finding ldap_initialize. Fix by moving the probe for ldap_initialize. In some sense this is more correct anyway, since (at least for now) we care about

Re: pgsql: Fix numeric_mul() overflow due to too many digits after decimal

2021-07-10 Thread Dean Rasheed
On Sat, 10 Jul 2021 at 16:01, Tom Lane wrote: > > I think this needs a bit more thought. Before, a case like > select 1e-16000 * 1e-16000; > produced > ERROR: value overflows numeric format > Now you get an exact zero (with a lot of trailing zeroes, but still > it's just zero).

Re: pgsql: Fix numeric_mul() overflow due to too many digits after decimal

2021-07-10 Thread Tom Lane
Dean Rasheed writes: > This fixes an overflow error when using the numeric * operator if the > result has more than 16383 digits after the decimal point by rounding > the result. Overflow errors should only occur if the result has too > many digits *before* the decimal point. I think this needs

pgsql: Add more sanity checks in SASL exchanges

2021-07-10 Thread Michael Paquier
Add more sanity checks in SASL exchanges The following checks are added, to make the SASL infrastructure more aware of defects when implementing new mechanisms: - Detect that no output is generated by a mechanism if an exchange fails in the backend, failing if there is a message waiting to be

pgsql: Fix numeric_mul() overflow due to too many digits after decimal

2021-07-10 Thread Dean Rasheed
Fix numeric_mul() overflow due to too many digits after decimal point. This fixes an overflow error when using the numeric * operator if the result has more than 16383 digits after the decimal point by rounding the result. Overflow errors should only occur if the result has too many digits

pgsql: Fix numeric_mul() overflow due to too many digits after decimal

2021-07-10 Thread Dean Rasheed
Fix numeric_mul() overflow due to too many digits after decimal point. This fixes an overflow error when using the numeric * operator if the result has more than 16383 digits after the decimal point by rounding the result. Overflow errors should only occur if the result has too many digits

pgsql: Fix numeric_mul() overflow due to too many digits after decimal

2021-07-10 Thread Dean Rasheed
Fix numeric_mul() overflow due to too many digits after decimal point. This fixes an overflow error when using the numeric * operator if the result has more than 16383 digits after the decimal point by rounding the result. Overflow errors should only occur if the result has too many digits

pgsql: Fix numeric_mul() overflow due to too many digits after decimal

2021-07-10 Thread Dean Rasheed
Fix numeric_mul() overflow due to too many digits after decimal point. This fixes an overflow error when using the numeric * operator if the result has more than 16383 digits after the decimal point by rounding the result. Overflow errors should only occur if the result has too many digits

pgsql: Fix numeric_mul() overflow due to too many digits after decimal

2021-07-10 Thread Dean Rasheed
Fix numeric_mul() overflow due to too many digits after decimal point. This fixes an overflow error when using the numeric * operator if the result has more than 16383 digits after the decimal point by rounding the result. Overflow errors should only occur if the result has too many digits

pgsql: Fix numeric_mul() overflow due to too many digits after decimal

2021-07-10 Thread Dean Rasheed
Fix numeric_mul() overflow due to too many digits after decimal point. This fixes an overflow error when using the numeric * operator if the result has more than 16383 digits after the decimal point by rounding the result. Overflow errors should only occur if the result has too many digits

pgsql: Fix numeric_mul() overflow due to too many digits after decimal

2021-07-10 Thread Dean Rasheed
Fix numeric_mul() overflow due to too many digits after decimal point. This fixes an overflow error when using the numeric * operator if the result has more than 16383 digits after the decimal point by rounding the result. Overflow errors should only occur if the result has too many digits