• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PowerDNS / pdns / 19957761886

05 Dec 2025 08:52AM UTC coverage: 73.063% (-0.07%) from 73.131%
19957761886

push

github

web-flow
Merge pull request #16590 from rgacogne/ddist-coverity-20251204

dnsdist: Fix missed optimizations reported by Coverity in config

38511 of 63422 branches covered (60.72%)

Branch coverage included in aggregate %.

3 of 5 new or added lines in 1 file covered. (60.0%)

13941 existing lines in 122 files now uncovered.

128037 of 164529 relevant lines covered (77.82%)

5473411.95 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/modules/gpgsqlbackend/spgsql.hh
1
/*
2
 * This file is part of PowerDNS or dnsdist.
3
 * Copyright -- PowerDNS.COM B.V. and its contributors
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of version 2 of the GNU General Public License as
7
 * published by the Free Software Foundation.
8
 *
9
 * In addition, for the avoidance of any doubt, permission is granted to
10
 * link this program with OpenSSL and to (re)distribute the binaries
11
 * produced as the result of such linking.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
 */
22
#pragma once
23
#include "pdns/namespaces.hh"
24
#include "pdns/backends/gsql/ssql.hh"
25

26
#include <libpq-fe.h>
27
class SPgSQL : public SSql
28
{
29
public:
30
  SPgSQL(const string& database, const string& host = "", const string& port = "",
31
         const string& user = "", const string& password = "",
32
         const string& extra_connection_parameters = "", const bool use_prepared = true);
33

34
  ~SPgSQL() override;
35

36
  SSqlException sPerrorException(const string& reason) override;
37
  void setLog(bool state) override;
38
  unique_ptr<SSqlStatement> prepare(const string& query, int nparams) override;
39
  void execute(const string& query) override;
40

41
  void startTransaction() override;
42
  void rollback() override;
43
  void commit() override;
44

45
  bool isConnectionUsable() override;
46
  void reconnect() override;
47

UNCOV
48
  PGconn* db() { return d_db; }
345,349✔
UNCOV
49
  bool in_trx() const { return d_in_trx; }
332,094✔
UNCOV
50
  bool usePrepared() { return d_use_prepared; }
7,147✔
51

52
private:
53
  PGconn* d_db;
54
  string d_connectstr;
55
  string d_connectlogstr;
56
  static bool s_dolog;
57
  bool d_in_trx;
58
  bool d_use_prepared;
59
  unsigned int d_nstatements;
60
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc