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

PowerDNS / pdns / 12268421405

11 Dec 2024 02:20AM UTC coverage: 64.728% (+3.2%) from 61.567%
12268421405

Pull #14954

github

web-flow
Merge d6414658d into 5089e2c08
Pull Request #14954: clang-tidy: use std::min/max

37522 of 88810 branches covered (42.25%)

Branch coverage included in aggregate %.

3 of 10 new or added lines in 4 files covered. (30.0%)

169 existing lines in 9 files now uncovered.

125906 of 163674 relevant lines covered (76.92%)

4802085.67 hits per line

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

97.71
/pdns/backends/gsql/gsqlbackend.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 <string>
24
#include <map>
25
#include "ssql.hh"
26
#include "pdns/arguments.hh"
27

28
#include "pdns/namespaces.hh"
29

30
bool isDnssecDomainMetadata (const string& name);
31

32
/*
33
GSQLBackend is a generic backend used by other sql backends
34
*/
35
class GSQLBackend : public DNSBackend
36
{
37
public:
38
  GSQLBackend(const string &mode, const string &suffix); //!< Makes our connection to the database. Throws an exception if it fails.
39
  ~GSQLBackend() override
40
  {
8,507✔
41
    freeStatements();
8,507✔
42
    d_db.reset();
8,507✔
43
  }
8,507✔
44

45
  void setDB(std::unique_ptr<SSql>&& database)
46
  {
8,982✔
47
    freeStatements();
8,982✔
48
    d_db = std::move(database);
8,982✔
49
    if (d_db) {
8,982✔
50
      d_db->setLog(::arg().mustDo("query-logging"));
8,975✔
51
    }
8,975✔
52
  }
8,982✔
53

54
protected:
55
  virtual void allocateStatements()
56
  {
8,978✔
57
    if (d_db) {
8,979✔
58
      d_NoIdQuery_stmt = d_db->prepare(d_NoIdQuery, 2);
8,978✔
59
      d_IdQuery_stmt = d_db->prepare(d_IdQuery, 3);
8,978✔
60
      d_ANYNoIdQuery_stmt = d_db->prepare(d_ANYNoIdQuery, 1);
8,978✔
61
      d_ANYIdQuery_stmt = d_db->prepare(d_ANYIdQuery, 2);
8,978✔
62
      d_listQuery_stmt = d_db->prepare(d_listQuery, 2);
8,978✔
63
      d_listSubZoneQuery_stmt = d_db->prepare(d_listSubZoneQuery, 3);
8,978✔
64
      d_PrimaryOfDomainsZoneQuery_stmt = d_db->prepare(d_PrimaryOfDomainsZoneQuery, 1);
8,978✔
65
      d_InfoOfDomainsZoneQuery_stmt = d_db->prepare(d_InfoOfDomainsZoneQuery, 1);
8,978✔
66
      d_InfoOfAllSecondaryDomainsQuery_stmt = d_db->prepare(d_InfoOfAllSecondaryDomainsQuery, 0);
8,978✔
67
      d_AutoPrimaryInfoQuery_stmt = d_db->prepare(d_AutoPrimaryInfoQuery, 2);
8,978✔
68
      d_GetAutoPrimaryIPs_stmt = d_db->prepare(d_GetAutoPrimaryIPs, 2);
8,978✔
69
      d_AddAutoPrimary_stmt = d_db->prepare(d_AddAutoPrimary, 3);
8,978✔
70
      d_RemoveAutoPrimary_stmt = d_db->prepare(d_RemoveAutoPrimaryQuery, 2);
8,978✔
71
      d_ListAutoPrimaries_stmt = d_db->prepare(d_ListAutoPrimariesQuery, 0);
8,978✔
72
      d_InsertZoneQuery_stmt = d_db->prepare(d_InsertZoneQuery, 4);
8,978✔
73
      d_InsertRecordQuery_stmt = d_db->prepare(d_InsertRecordQuery, 9);
8,978✔
74
      d_InsertEmptyNonTerminalOrderQuery_stmt = d_db->prepare(d_InsertEmptyNonTerminalOrderQuery, 4);
8,978✔
75
      d_UpdatePrimaryOfZoneQuery_stmt = d_db->prepare(d_UpdatePrimaryOfZoneQuery, 2);
8,978✔
76
      d_UpdateKindOfZoneQuery_stmt = d_db->prepare(d_UpdateKindOfZoneQuery, 2);
8,978✔
77
      d_UpdateOptionsOfZoneQuery_stmt = d_db->prepare(d_UpdateOptionsOfZoneQuery, 2);
8,978✔
78
      d_UpdateCatalogOfZoneQuery_stmt = d_db->prepare(d_UpdateCatalogOfZoneQuery, 2);
8,978✔
79
      d_UpdateAccountOfZoneQuery_stmt = d_db->prepare(d_UpdateAccountOfZoneQuery, 2);
8,978✔
80
      d_UpdateSerialOfZoneQuery_stmt = d_db->prepare(d_UpdateSerialOfZoneQuery, 2);
8,978✔
81
      d_UpdateLastCheckOfZoneQuery_stmt = d_db->prepare(d_UpdateLastCheckOfZoneQuery, 2);
8,978✔
82
      d_InfoOfAllPrimaryDomainsQuery_stmt = d_db->prepare(d_InfoOfAllPrimaryDomainsQuery, 0);
8,978✔
83
      d_InfoProducerMembersQuery_stmt = d_db->prepare(d_InfoProducerMembersQuery, 1);
8,978✔
84
      d_InfoConsumerMembersQuery_stmt = d_db->prepare(d_InfoConsumerMembersQuery, 1);
8,978✔
85
      d_DeleteDomainQuery_stmt = d_db->prepare(d_DeleteDomainQuery, 1);
8,978✔
86
      d_DeleteZoneQuery_stmt = d_db->prepare(d_DeleteZoneQuery, 1);
8,978✔
87
      d_DeleteRRSetQuery_stmt = d_db->prepare(d_DeleteRRSetQuery, 3);
8,978✔
88
      d_DeleteNamesQuery_stmt = d_db->prepare(d_DeleteNamesQuery, 2);
8,978✔
89
      d_firstOrderQuery_stmt = d_db->prepare(d_firstOrderQuery, 1);
8,978✔
90
      d_beforeOrderQuery_stmt = d_db->prepare(d_beforeOrderQuery, 2);
8,978✔
91
      d_afterOrderQuery_stmt = d_db->prepare(d_afterOrderQuery, 2);
8,978✔
92
      d_lastOrderQuery_stmt = d_db->prepare(d_lastOrderQuery, 1);
8,978✔
93
      d_updateOrderNameAndAuthQuery_stmt = d_db->prepare(d_updateOrderNameAndAuthQuery, 4);
8,978✔
94
      d_updateOrderNameAndAuthTypeQuery_stmt = d_db->prepare(d_updateOrderNameAndAuthTypeQuery, 5);
8,978✔
95
      d_nullifyOrderNameAndUpdateAuthQuery_stmt = d_db->prepare(d_nullifyOrderNameAndUpdateAuthQuery, 3);
8,978✔
96
      d_nullifyOrderNameAndUpdateAuthTypeQuery_stmt = d_db->prepare(d_nullifyOrderNameAndUpdateAuthTypeQuery, 4);
8,978✔
97
      d_RemoveEmptyNonTerminalsFromZoneQuery_stmt = d_db->prepare(d_RemoveEmptyNonTerminalsFromZoneQuery, 1);
8,978✔
98
      d_DeleteEmptyNonTerminalQuery_stmt = d_db->prepare(d_DeleteEmptyNonTerminalQuery, 2);
8,978✔
99
      d_AddDomainKeyQuery_stmt = d_db->prepare(d_AddDomainKeyQuery, 5);
8,978✔
100
      d_GetLastInsertedKeyIdQuery_stmt = d_db->prepare(d_GetLastInsertedKeyIdQuery, 0);
8,978✔
101
      d_ListDomainKeysQuery_stmt = d_db->prepare(d_ListDomainKeysQuery, 1);
8,978✔
102
      d_GetAllDomainMetadataQuery_stmt = d_db->prepare(d_GetAllDomainMetadataQuery, 1);
8,978✔
103
      d_GetDomainMetadataQuery_stmt = d_db->prepare(d_GetDomainMetadataQuery, 2);
8,978✔
104
      d_ClearDomainMetadataQuery_stmt = d_db->prepare(d_ClearDomainMetadataQuery, 2);
8,978✔
105
      d_ClearDomainAllMetadataQuery_stmt = d_db->prepare(d_ClearDomainAllMetadataQuery, 1);
8,978✔
106
      d_SetDomainMetadataQuery_stmt = d_db->prepare(d_SetDomainMetadataQuery, 3);
8,978✔
107
      d_RemoveDomainKeyQuery_stmt = d_db->prepare(d_RemoveDomainKeyQuery, 2);
8,978✔
108
      d_ActivateDomainKeyQuery_stmt = d_db->prepare(d_ActivateDomainKeyQuery, 2);
8,978✔
109
      d_DeactivateDomainKeyQuery_stmt = d_db->prepare(d_DeactivateDomainKeyQuery, 2);
8,978✔
110
      d_PublishDomainKeyQuery_stmt = d_db->prepare(d_PublishDomainKeyQuery, 2);
8,978✔
111
      d_UnpublishDomainKeyQuery_stmt = d_db->prepare(d_UnpublishDomainKeyQuery, 2);
8,978✔
112
      d_ClearDomainAllKeysQuery_stmt = d_db->prepare(d_ClearDomainAllKeysQuery, 1);
8,978✔
113
      d_getTSIGKeyQuery_stmt = d_db->prepare(d_getTSIGKeyQuery, 1);
8,978✔
114
      d_setTSIGKeyQuery_stmt = d_db->prepare(d_setTSIGKeyQuery, 3);
8,978✔
115
      d_deleteTSIGKeyQuery_stmt = d_db->prepare(d_deleteTSIGKeyQuery, 1);
8,978✔
116
      d_getTSIGKeysQuery_stmt = d_db->prepare(d_getTSIGKeysQuery, 0);
8,978✔
117
      d_getAllDomainsQuery_stmt = d_db->prepare(d_getAllDomainsQuery, 1);
8,978✔
118
      d_ListCommentsQuery_stmt = d_db->prepare(d_ListCommentsQuery, 1);
8,978✔
119
      d_InsertCommentQuery_stmt = d_db->prepare(d_InsertCommentQuery, 6);
8,978✔
120
      d_DeleteCommentRRsetQuery_stmt = d_db->prepare(d_DeleteCommentRRsetQuery, 3);
8,978✔
121
      d_DeleteCommentsQuery_stmt = d_db->prepare(d_DeleteCommentsQuery, 1);
8,978✔
122
      d_SearchRecordsQuery_stmt = d_db->prepare(d_SearchRecordsQuery, 3);
8,978✔
123
      d_SearchCommentsQuery_stmt = d_db->prepare(d_SearchCommentsQuery, 3);
8,978✔
124
    }
8,978✔
125
  }
8,978✔
126

127
  virtual void freeStatements() {
17,489✔
128
    d_NoIdQuery_stmt.reset();
17,489✔
129
    d_IdQuery_stmt.reset();
17,489✔
130
    d_ANYNoIdQuery_stmt.reset();
17,489✔
131
    d_ANYIdQuery_stmt.reset();
17,489✔
132
    d_listQuery_stmt.reset();
17,489✔
133
    d_listSubZoneQuery_stmt.reset();
17,489✔
134
    d_PrimaryOfDomainsZoneQuery_stmt.reset();
17,489✔
135
    d_InfoOfDomainsZoneQuery_stmt.reset();
17,489✔
136
    d_InfoOfAllSecondaryDomainsQuery_stmt.reset();
17,489✔
137
    d_AutoPrimaryInfoQuery_stmt.reset();
17,489✔
138
    d_GetAutoPrimaryIPs_stmt.reset();
17,489✔
139
    d_AddAutoPrimary_stmt.reset();
17,489✔
140
    d_RemoveAutoPrimary_stmt.reset();
17,489✔
141
    d_ListAutoPrimaries_stmt.reset();
17,489✔
142
    d_InsertZoneQuery_stmt.reset();
17,489✔
143
    d_InsertRecordQuery_stmt.reset();
17,489✔
144
    d_InsertEmptyNonTerminalOrderQuery_stmt.reset();
17,489✔
145
    d_UpdatePrimaryOfZoneQuery_stmt.reset();
17,489✔
146
    d_UpdateKindOfZoneQuery_stmt.reset();
17,489✔
147
    d_UpdateOptionsOfZoneQuery_stmt.reset();
17,489✔
148
    d_UpdateCatalogOfZoneQuery_stmt.reset();
17,489✔
149
    d_UpdateAccountOfZoneQuery_stmt.reset();
17,489✔
150
    d_UpdateSerialOfZoneQuery_stmt.reset();
17,489✔
151
    d_UpdateLastCheckOfZoneQuery_stmt.reset();
17,489✔
152
    d_InfoOfAllPrimaryDomainsQuery_stmt.reset();
17,489✔
153
    d_InfoProducerMembersQuery_stmt.reset();
17,489✔
154
    d_InfoConsumerMembersQuery_stmt.reset();
17,489✔
155
    d_DeleteDomainQuery_stmt.reset();
17,489✔
156
    d_DeleteZoneQuery_stmt.reset();
17,489✔
157
    d_DeleteRRSetQuery_stmt.reset();
17,489✔
158
    d_DeleteNamesQuery_stmt.reset();
17,489✔
159
    d_firstOrderQuery_stmt.reset();
17,489✔
160
    d_beforeOrderQuery_stmt.reset();
17,489✔
161
    d_afterOrderQuery_stmt.reset();
17,489✔
162
    d_lastOrderQuery_stmt.reset();
17,489✔
163
    d_updateOrderNameAndAuthQuery_stmt.reset();
17,489✔
164
    d_updateOrderNameAndAuthTypeQuery_stmt.reset();
17,489✔
165
    d_nullifyOrderNameAndUpdateAuthQuery_stmt.reset();
17,489✔
166
    d_nullifyOrderNameAndUpdateAuthTypeQuery_stmt.reset();
17,489✔
167
    d_RemoveEmptyNonTerminalsFromZoneQuery_stmt.reset();
17,489✔
168
    d_DeleteEmptyNonTerminalQuery_stmt.reset();
17,489✔
169
    d_AddDomainKeyQuery_stmt.reset();
17,489✔
170
    d_GetLastInsertedKeyIdQuery_stmt.reset();
17,489✔
171
    d_ListDomainKeysQuery_stmt.reset();
17,489✔
172
    d_GetAllDomainMetadataQuery_stmt.reset();
17,489✔
173
    d_GetDomainMetadataQuery_stmt.reset();
17,489✔
174
    d_ClearDomainMetadataQuery_stmt.reset();
17,489✔
175
    d_ClearDomainAllMetadataQuery_stmt.reset();
17,489✔
176
    d_SetDomainMetadataQuery_stmt.reset();
17,489✔
177
    d_RemoveDomainKeyQuery_stmt.reset();
17,489✔
178
    d_ActivateDomainKeyQuery_stmt.reset();
17,489✔
179
    d_DeactivateDomainKeyQuery_stmt.reset();
17,489✔
180
    d_PublishDomainKeyQuery_stmt.reset();
17,489✔
181
    d_UnpublishDomainKeyQuery_stmt.reset();
17,489✔
182
    d_ClearDomainAllKeysQuery_stmt.reset();
17,489✔
183
    d_getTSIGKeyQuery_stmt.reset();
17,489✔
184
    d_setTSIGKeyQuery_stmt.reset();
17,489✔
185
    d_deleteTSIGKeyQuery_stmt.reset();
17,489✔
186
    d_getTSIGKeysQuery_stmt.reset();
17,489✔
187
    d_getAllDomainsQuery_stmt.reset();
17,489✔
188
    d_ListCommentsQuery_stmt.reset();
17,489✔
189
    d_InsertCommentQuery_stmt.reset();
17,489✔
190
    d_DeleteCommentRRsetQuery_stmt.reset();
17,489✔
191
    d_DeleteCommentsQuery_stmt.reset();
17,489✔
192
    d_SearchRecordsQuery_stmt.reset();
17,489✔
193
    d_SearchCommentsQuery_stmt.reset();
17,489✔
194
  }
17,489✔
195

196
public:
197
  void lookup(const QType &, const DNSName &qdomain, int zoneId, DNSPacket *p=nullptr) override;
198
  bool list(const DNSName &target, int domain_id, bool include_disabled=false) override;
199
  bool get(DNSResourceRecord &r) override;
200
  void getAllDomains(vector<DomainInfo>* domains, bool getSerial, bool include_disabled) override;
201
  bool startTransaction(const DNSName &domain, int domain_id=-1) override;
202
  bool commitTransaction() override;
203
  bool abortTransaction() override;
204
  bool feedRecord(const DNSResourceRecord &r, const DNSName &ordername, bool ordernameIsNSEC3=false) override;
205
  bool feedEnts(int domain_id, map<DNSName,bool>& nonterm) override;
206
  bool feedEnts3(int domain_id, const DNSName &domain, map<DNSName,bool> &nonterm, const NSEC3PARAMRecordContent& ns3prc, bool narrow) override;
207
  bool createDomain(const DNSName& domain, const DomainInfo::DomainKind kind, const vector<ComboAddress>& primaries, const string& account) override;
208
  bool createSecondaryDomain(const string& ip, const DNSName& domain, const string& nameserver, const string& account) override;
209
  bool deleteDomain(const DNSName &domain) override;
210
  bool autoPrimaryAdd(const AutoPrimary& primary) override;
211
  bool autoPrimaryRemove(const AutoPrimary& primary) override;
212
  bool autoPrimariesList(std::vector<AutoPrimary>& primaries) override;
213
  bool autoPrimaryBackend(const string& ip, const DNSName& domain, const vector<DNSResourceRecord>& nsset, string* nameserver, string* account, DNSBackend** db) override;
214
  void setStale(uint32_t domain_id) override;
215
  void setFresh(uint32_t domain_id) override;
216
  void getUnfreshSecondaryInfos(vector<DomainInfo>* domains) override;
217
  void getUpdatedPrimaries(vector<DomainInfo>& updatedDomains, std::unordered_set<DNSName>& catalogs, CatalogHashMap& catalogHashes) override;
218
  bool getCatalogMembers(const DNSName& catalog, vector<CatalogInfo>& members, CatalogInfo::CatalogType type) override;
219
  bool getDomainInfo(const DNSName &domain, DomainInfo &di, bool getSerial=true) override;
220
  void setNotified(uint32_t domain_id, uint32_t serial) override;
221
  bool setPrimaries(const DNSName& domain, const vector<ComboAddress>& primaries) override;
222
  bool setKind(const DNSName &domain, const DomainInfo::DomainKind kind) override;
223
  bool setOptions(const DNSName& domain, const string& options) override;
224
  bool setCatalog(const DNSName& domain, const DNSName& catalog) override;
225
  bool setAccount(const DNSName &domain, const string &account) override;
226

227
  bool getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qname, DNSName& unhashed, DNSName& before, DNSName& after) override;
228
  bool updateDNSSECOrderNameAndAuth(uint32_t domain_id, const DNSName& qname, const DNSName& ordername, bool auth, const uint16_t=QType::ANY) override;
229

230
  bool updateEmptyNonTerminals(uint32_t domain_id, set<DNSName>& insert ,set<DNSName>& erase, bool remove) override;
231
  bool doesDNSSEC() override;
232

233
  bool replaceRRSet(uint32_t domain_id, const DNSName& qname, const QType& qt, const vector<DNSResourceRecord>& rrset) override;
234
  bool listSubZone(const DNSName &zone, int domain_id) override;
235
  bool addDomainKey(const DNSName& name, const KeyData& key, int64_t& id) override;
236
  bool getDomainKeys(const DNSName& name, std::vector<KeyData>& keys) override;
237
  bool getAllDomainMetadata(const DNSName& name, std::map<std::string, std::vector<std::string> >& meta) override;
238
  bool getDomainMetadata(const DNSName& name, const std::string& kind, std::vector<std::string>& meta) override;
239
  bool setDomainMetadata(const DNSName& name, const std::string& kind, const std::vector<std::string>& meta) override;
240

241
  bool removeDomainKey(const DNSName& name, unsigned int id) override;
242
  bool activateDomainKey(const DNSName& name, unsigned int id) override;
243
  bool deactivateDomainKey(const DNSName& name, unsigned int id) override;
244
  bool publishDomainKey(const DNSName& name, unsigned int id) override;
245
  bool unpublishDomainKey(const DNSName& name, unsigned int id) override;
246

247
  bool getTSIGKey(const DNSName& name, DNSName& algorithm, string& content) override;
248
  bool setTSIGKey(const DNSName& name, const DNSName& algorithm, const string& content) override;
249
  bool deleteTSIGKey(const DNSName& name) override;
250
  bool getTSIGKeys(std::vector< struct TSIGKey > &keys) override;
251

252
  bool listComments(const uint32_t domain_id) override;
253
  bool getComment(Comment& comment) override;
254
  bool feedComment(const Comment& comment) override;
255
  bool replaceComments(const uint32_t domain_id, const DNSName& qname, const QType& qt, const vector<Comment>& comments) override;
256
  string directBackendCmd(const string &query) override;
257
  bool searchRecords(const string &pattern, size_t maxResults, vector<DNSResourceRecord>& result) override;
258
  bool searchComments(const string &pattern, size_t maxResults, vector<Comment>& result) override;
259

260
protected:
261
  string pattern2SQLPattern(const string& pattern);
262
  void extractRecord(SSqlStatement::row_t& row, DNSResourceRecord& rr);
263
  void extractComment(SSqlStatement::row_t& row, Comment& c);
264
  void setLastCheck(uint32_t domain_id, time_t lastcheck);
265
  bool isConnectionUsable() {
135,255✔
266
    if (d_db) {
135,255!
267
      return d_db->isConnectionUsable();
135,255✔
268
    }
135,255✔
UNCOV
269
    return false;
×
270
  }
135,255✔
271
  void reconnectIfNeeded()
272
  {
1,348,812✔
273
    if (inTransaction() || isConnectionUsable()) {
1,348,812!
274
      return;
1,348,811✔
275
    }
1,348,811✔
276

277
    reconnect();
1✔
278
  }
1✔
279
  virtual void reconnect() { }
×
280
  bool inTransaction() override
281
  {
1,022,485✔
282
    return d_inTransaction;
1,022,485✔
283
  }
1,022,485✔
284

285
  bool d_list{false};
286
  string d_query_name;
287
  DNSName d_qname;
288
  SSqlStatement::result_t d_result;
289
  unique_ptr<SSqlStatement>* d_query_stmt;
290

291
private:
292
  string d_NoIdQuery;
293
  string d_IdQuery;
294
  string d_ANYNoIdQuery;
295
  string d_ANYIdQuery;
296

297
  string d_listQuery;
298
  string d_listSubZoneQuery;
299
  string d_logprefix;
300

301
  string d_PrimaryOfDomainsZoneQuery;
302
  string d_InfoOfDomainsZoneQuery;
303
  string d_InfoOfAllSecondaryDomainsQuery;
304
  string d_AutoPrimaryInfoQuery;
305
  string d_GetAutoPrimaryName;
306
  string d_GetAutoPrimaryIPs;
307
  string d_AddAutoPrimary;
308
  string d_RemoveAutoPrimaryQuery;
309
  string d_ListAutoPrimariesQuery;
310

311
  string d_InsertZoneQuery;
312
  string d_InsertRecordQuery;
313
  string d_InsertEmptyNonTerminalOrderQuery;
314
  string d_UpdatePrimaryOfZoneQuery;
315
  string d_UpdateKindOfZoneQuery;
316
  string d_UpdateOptionsOfZoneQuery;
317
  string d_UpdateCatalogOfZoneQuery;
318
  string d_UpdateAccountOfZoneQuery;
319
  string d_UpdateSerialOfZoneQuery;
320
  string d_UpdateLastCheckOfZoneQuery;
321
  string d_InfoOfAllPrimaryDomainsQuery;
322
  string d_InfoProducerMembersQuery;
323
  string d_InfoConsumerMembersQuery;
324
  string d_DeleteDomainQuery;
325
  string d_DeleteZoneQuery;
326
  string d_DeleteRRSetQuery;
327
  string d_DeleteNamesQuery;
328

329
  string d_firstOrderQuery;
330
  string d_beforeOrderQuery;
331
  string d_afterOrderQuery;
332
  string d_lastOrderQuery;
333

334
  string d_updateOrderNameAndAuthQuery;
335
  string d_updateOrderNameAndAuthTypeQuery;
336
  string d_nullifyOrderNameAndUpdateAuthQuery;
337
  string d_nullifyOrderNameAndUpdateAuthTypeQuery;
338

339
  string d_RemoveEmptyNonTerminalsFromZoneQuery;
340
  string d_DeleteEmptyNonTerminalQuery;
341

342
  string d_AddDomainKeyQuery;
343
  string d_GetLastInsertedKeyIdQuery;
344
  string d_ListDomainKeysQuery;
345
  string d_GetAllDomainMetadataQuery;
346
  string d_GetDomainMetadataQuery;
347
  string d_ClearDomainMetadataQuery;
348
  string d_ClearDomainAllMetadataQuery;
349
  string d_SetDomainMetadataQuery;
350

351
  string d_RemoveDomainKeyQuery;
352
  string d_ActivateDomainKeyQuery;
353
  string d_DeactivateDomainKeyQuery;
354
  string d_PublishDomainKeyQuery;
355
  string d_UnpublishDomainKeyQuery;
356
  string d_ClearDomainAllKeysQuery;
357

358
  string d_getTSIGKeyQuery;
359
  string d_setTSIGKeyQuery;
360
  string d_deleteTSIGKeyQuery;
361
  string d_getTSIGKeysQuery;
362

363
  string d_getAllDomainsQuery;
364

365
  string d_ListCommentsQuery;
366
  string d_InsertCommentQuery;
367
  string d_DeleteCommentRRsetQuery;
368
  string d_DeleteCommentsQuery;
369

370
  string d_SearchRecordsQuery;
371
  string d_SearchCommentsQuery;
372

373

374
  unique_ptr<SSqlStatement> d_NoIdQuery_stmt;
375
  unique_ptr<SSqlStatement> d_IdQuery_stmt;
376
  unique_ptr<SSqlStatement> d_ANYNoIdQuery_stmt;
377
  unique_ptr<SSqlStatement> d_ANYIdQuery_stmt;
378
  unique_ptr<SSqlStatement> d_listQuery_stmt;
379
  unique_ptr<SSqlStatement> d_listSubZoneQuery_stmt;
380
  unique_ptr<SSqlStatement> d_PrimaryOfDomainsZoneQuery_stmt;
381
  unique_ptr<SSqlStatement> d_InfoOfDomainsZoneQuery_stmt;
382
  unique_ptr<SSqlStatement> d_InfoOfAllSecondaryDomainsQuery_stmt;
383
  unique_ptr<SSqlStatement> d_AutoPrimaryInfoQuery_stmt;
384
  unique_ptr<SSqlStatement> d_GetAutoPrimaryIPs_stmt;
385
  unique_ptr<SSqlStatement> d_AddAutoPrimary_stmt;
386
  unique_ptr<SSqlStatement> d_RemoveAutoPrimary_stmt;
387
  unique_ptr<SSqlStatement> d_ListAutoPrimaries_stmt;
388
  unique_ptr<SSqlStatement> d_InsertZoneQuery_stmt;
389
  unique_ptr<SSqlStatement> d_InsertRecordQuery_stmt;
390
  unique_ptr<SSqlStatement> d_InsertEmptyNonTerminalOrderQuery_stmt;
391
  unique_ptr<SSqlStatement> d_UpdatePrimaryOfZoneQuery_stmt;
392
  unique_ptr<SSqlStatement> d_UpdateKindOfZoneQuery_stmt;
393
  unique_ptr<SSqlStatement> d_UpdateOptionsOfZoneQuery_stmt;
394
  unique_ptr<SSqlStatement> d_UpdateCatalogOfZoneQuery_stmt;
395
  unique_ptr<SSqlStatement> d_UpdateAccountOfZoneQuery_stmt;
396
  unique_ptr<SSqlStatement> d_UpdateSerialOfZoneQuery_stmt;
397
  unique_ptr<SSqlStatement> d_UpdateLastCheckOfZoneQuery_stmt;
398
  unique_ptr<SSqlStatement> d_InfoOfAllPrimaryDomainsQuery_stmt;
399
  unique_ptr<SSqlStatement> d_InfoProducerMembersQuery_stmt;
400
  unique_ptr<SSqlStatement> d_InfoConsumerMembersQuery_stmt;
401
  unique_ptr<SSqlStatement> d_DeleteDomainQuery_stmt;
402
  unique_ptr<SSqlStatement> d_DeleteZoneQuery_stmt;
403
  unique_ptr<SSqlStatement> d_DeleteRRSetQuery_stmt;
404
  unique_ptr<SSqlStatement> d_DeleteNamesQuery_stmt;
405
  unique_ptr<SSqlStatement> d_firstOrderQuery_stmt;
406
  unique_ptr<SSqlStatement> d_beforeOrderQuery_stmt;
407
  unique_ptr<SSqlStatement> d_afterOrderQuery_stmt;
408
  unique_ptr<SSqlStatement> d_lastOrderQuery_stmt;
409
  unique_ptr<SSqlStatement> d_updateOrderNameAndAuthQuery_stmt;
410
  unique_ptr<SSqlStatement> d_updateOrderNameAndAuthTypeQuery_stmt;
411
  unique_ptr<SSqlStatement> d_nullifyOrderNameAndUpdateAuthQuery_stmt;
412
  unique_ptr<SSqlStatement> d_nullifyOrderNameAndUpdateAuthTypeQuery_stmt;
413
  unique_ptr<SSqlStatement> d_RemoveEmptyNonTerminalsFromZoneQuery_stmt;
414
  unique_ptr<SSqlStatement> d_DeleteEmptyNonTerminalQuery_stmt;
415
  unique_ptr<SSqlStatement> d_AddDomainKeyQuery_stmt;
416
  unique_ptr<SSqlStatement> d_GetLastInsertedKeyIdQuery_stmt;
417
  unique_ptr<SSqlStatement> d_ListDomainKeysQuery_stmt;
418
  unique_ptr<SSqlStatement> d_GetAllDomainMetadataQuery_stmt;
419
  unique_ptr<SSqlStatement> d_GetDomainMetadataQuery_stmt;
420
  unique_ptr<SSqlStatement> d_ClearDomainMetadataQuery_stmt;
421
  unique_ptr<SSqlStatement> d_ClearDomainAllMetadataQuery_stmt;
422
  unique_ptr<SSqlStatement> d_SetDomainMetadataQuery_stmt;
423
  unique_ptr<SSqlStatement> d_RemoveDomainKeyQuery_stmt;
424
  unique_ptr<SSqlStatement> d_ActivateDomainKeyQuery_stmt;
425
  unique_ptr<SSqlStatement> d_DeactivateDomainKeyQuery_stmt;
426
  unique_ptr<SSqlStatement> d_PublishDomainKeyQuery_stmt;
427
  unique_ptr<SSqlStatement> d_UnpublishDomainKeyQuery_stmt;
428
  unique_ptr<SSqlStatement> d_ClearDomainAllKeysQuery_stmt;
429
  unique_ptr<SSqlStatement> d_getTSIGKeyQuery_stmt;
430
  unique_ptr<SSqlStatement> d_setTSIGKeyQuery_stmt;
431
  unique_ptr<SSqlStatement> d_deleteTSIGKeyQuery_stmt;
432
  unique_ptr<SSqlStatement> d_getTSIGKeysQuery_stmt;
433
  unique_ptr<SSqlStatement> d_getAllDomainsQuery_stmt;
434
  unique_ptr<SSqlStatement> d_ListCommentsQuery_stmt;
435
  unique_ptr<SSqlStatement> d_InsertCommentQuery_stmt;
436
  unique_ptr<SSqlStatement> d_DeleteCommentRRsetQuery_stmt;
437
  unique_ptr<SSqlStatement> d_DeleteCommentsQuery_stmt;
438
  unique_ptr<SSqlStatement> d_SearchRecordsQuery_stmt;
439
  unique_ptr<SSqlStatement> d_SearchCommentsQuery_stmt;
440

441
protected:
442
  std::unique_ptr<SSql> d_db{nullptr};
443
  bool d_dnssecQueries;
444
  bool d_inTransaction{false};
445
  bool d_upgradeContent{false};
446
};
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

© 2025 Coveralls, Inc