change pgConn, frmLog, frmStatus

При возникновении ошибки "server closed the connection unexpectedly"
сообщение об этом не выводиться на экран. Т.к. происходило падение pgAdmin3
В frmLog добалены сохраняемые пользовательские фильтры.
 По кнопке Add текущий фильтр сохраняется. Имя задается в ComboBox.
В окне "Status Server" устанавливается парамер "SET statement_timeout=10000;"
чтобы избежать зависания функции pg_query_state.
This commit is contained in:
lsv 2021-12-09 15:00:10 +05:00
parent 4db8267ae6
commit 4684ada1ac
12 changed files with 505 additions and 49 deletions

View file

@ -976,13 +976,20 @@ void pgConn::LogError(const bool quiet)
{
if (conn)
{
if (quiet)
bool abnormal_termination = false;
wxString err = GetLastError().Trim();
if (err.Find("server closed the connection unexpectedly") >= 0) {
//Close();
//connStatus = PGCONN_BROKEN;
abnormal_termination = true;
}
if (quiet || abnormal_termination)
{
wxLogQuietError(wxT("%s"), GetLastError().Trim().c_str());
wxLogQuietError(wxT("%s"), err.c_str());
}
else
{
wxLogError(wxT("%s"), GetLastError().Trim().c_str());
wxLogError(wxT("%s"), err.c_str());
IsAlive();
}
}