Postgresql bind array handling asserts when compiling with -Wp,-D_GLIBCXX_ASSERTIONS
Compiling with -Wp,-D_GLIBCXX_ASSERTIONS can cause asserts within Postgresql library, revolving around the vectors derived from PsqlBindArray which are passed into calls such as PQexecPrepared. At least one case can occur when the number of statement parameters is 0 and we pass in empty vectors (something we have done elsewhere without issue). PostgreSQL documentation says that one may pass in nul pointers when the number of parameters is zero and this does seem to avoid the problem.
The instigating case is a failed unit test:
[ RUN ] PgSqlConfigBackendDHCPv4Test.createUpdateDeleteServer /usr/include/c++/8/bits/stl_vector.h:950: std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator(std::vector<_Tp, _Alloc>::size_type) const [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::const_reference = const int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed. /bin/bash: line 5: 30847 Aborted