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

PowerDNS / pdns / 12323094430

13 Dec 2024 09:11PM UTC coverage: 64.759% (-0.02%) from 64.78%
12323094430

Pull #14970

github

web-flow
Merge 3e4597ff7 into 3dfd8e317
Pull Request #14970: boost > std optional

37533 of 88820 branches covered (42.26%)

Branch coverage included in aggregate %.

17 of 19 new or added lines in 4 files covered. (89.47%)

79 existing lines in 16 files now uncovered.

125890 of 163537 relevant lines covered (76.98%)

4110788.26 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,678✔
41
    freeStatements();
8,678✔
42
    d_db.reset();
8,678✔
43
  }
8,678✔
44

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

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

127
  virtual void freeStatements() {
17,831✔
128
    d_NoIdQuery_stmt.reset();
17,831✔
129
    d_IdQuery_stmt.reset();
17,831✔
130
    d_ANYNoIdQuery_stmt.reset();
17,831✔
131
    d_ANYIdQuery_stmt.reset();
17,831✔
132
    d_listQuery_stmt.reset();
17,831✔
133
    d_listSubZoneQuery_stmt.reset();
17,831✔
134
    d_PrimaryOfDomainsZoneQuery_stmt.reset();
17,831✔
135
    d_InfoOfDomainsZoneQuery_stmt.reset();
17,831✔
136
    d_InfoOfAllSecondaryDomainsQuery_stmt.reset();
17,831✔
137
    d_AutoPrimaryInfoQuery_stmt.reset();
17,831✔
138
    d_GetAutoPrimaryIPs_stmt.reset();
17,831✔
139
    d_AddAutoPrimary_stmt.reset();
17,831✔
140
    d_RemoveAutoPrimary_stmt.reset();
17,831✔
141
    d_ListAutoPrimaries_stmt.reset();
17,831✔
142
    d_InsertZoneQuery_stmt.reset();
17,831✔
143
    d_InsertRecordQuery_stmt.reset();
17,831✔
144
    d_InsertEmptyNonTerminalOrderQuery_stmt.reset();
17,831✔
145
    d_UpdatePrimaryOfZoneQuery_stmt.reset();
17,831✔
146
    d_UpdateKindOfZoneQuery_stmt.reset();
17,831✔
147
    d_UpdateOptionsOfZoneQuery_stmt.reset();
17,831✔
148
    d_UpdateCatalogOfZoneQuery_stmt.reset();
17,831✔
149
    d_UpdateAccountOfZoneQuery_stmt.reset();
17,831✔
150
    d_UpdateSerialOfZoneQuery_stmt.reset();
17,831✔
151
    d_UpdateLastCheckOfZoneQuery_stmt.reset();
17,831✔
152
    d_InfoOfAllPrimaryDomainsQuery_stmt.reset();
17,831✔
153
    d_InfoProducerMembersQuery_stmt.reset();
17,831✔
154
    d_InfoConsumerMembersQuery_stmt.reset();
17,831✔
155
    d_DeleteDomainQuery_stmt.reset();
17,831✔
156
    d_DeleteZoneQuery_stmt.reset();
17,831✔
157
    d_DeleteRRSetQuery_stmt.reset();
17,831✔
158
    d_DeleteNamesQuery_stmt.reset();
17,831✔
159
    d_firstOrderQuery_stmt.reset();
17,831✔
160
    d_beforeOrderQuery_stmt.reset();
17,831✔
161
    d_afterOrderQuery_stmt.reset();
17,831✔
162
    d_lastOrderQuery_stmt.reset();
17,831✔
163
    d_updateOrderNameAndAuthQuery_stmt.reset();
17,831✔
164
    d_updateOrderNameAndAuthTypeQuery_stmt.reset();
17,831✔
165
    d_nullifyOrderNameAndUpdateAuthQuery_stmt.reset();
17,831✔
166
    d_nullifyOrderNameAndUpdateAuthTypeQuery_stmt.reset();
17,831✔
167
    d_RemoveEmptyNonTerminalsFromZoneQuery_stmt.reset();
17,831✔
168
    d_DeleteEmptyNonTerminalQuery_stmt.reset();
17,831✔
169
    d_AddDomainKeyQuery_stmt.reset();
17,831✔
170
    d_GetLastInsertedKeyIdQuery_stmt.reset();
17,831✔
171
    d_ListDomainKeysQuery_stmt.reset();
17,831✔
172
    d_GetAllDomainMetadataQuery_stmt.reset();
17,831✔
173
    d_GetDomainMetadataQuery_stmt.reset();
17,831✔
174
    d_ClearDomainMetadataQuery_stmt.reset();
17,831✔
175
    d_ClearDomainAllMetadataQuery_stmt.reset();
17,831✔
176
    d_SetDomainMetadataQuery_stmt.reset();
17,831✔
177
    d_RemoveDomainKeyQuery_stmt.reset();
17,831✔
178
    d_ActivateDomainKeyQuery_stmt.reset();
17,831✔
179
    d_DeactivateDomainKeyQuery_stmt.reset();
17,831✔
180
    d_PublishDomainKeyQuery_stmt.reset();
17,831✔
181
    d_UnpublishDomainKeyQuery_stmt.reset();
17,831✔
182
    d_ClearDomainAllKeysQuery_stmt.reset();
17,831✔
183
    d_getTSIGKeyQuery_stmt.reset();
17,831✔
184
    d_setTSIGKeyQuery_stmt.reset();
17,831✔
185
    d_deleteTSIGKeyQuery_stmt.reset();
17,831✔
186
    d_getTSIGKeysQuery_stmt.reset();
17,831✔
187
    d_getAllDomainsQuery_stmt.reset();
17,831✔
188
    d_ListCommentsQuery_stmt.reset();
17,831✔
189
    d_InsertCommentQuery_stmt.reset();
17,831✔
190
    d_DeleteCommentRRsetQuery_stmt.reset();
17,831✔
191
    d_DeleteCommentsQuery_stmt.reset();
17,831✔
192
    d_SearchRecordsQuery_stmt.reset();
17,831✔
193
    d_SearchCommentsQuery_stmt.reset();
17,831✔
194
  }
17,831✔
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,671✔
266
    if (d_db) {
135,672✔
267
      return d_db->isConnectionUsable();
135,672✔
268
    }
135,672✔
269
    return false;
2,147,483,647✔
270
  }
135,671✔
271
  void reconnectIfNeeded()
272
  {
1,349,334✔
273
    if (inTransaction() || isConnectionUsable()) {
1,349,334!
274
      return;
1,349,334✔
275
    }
1,349,334✔
276

UNCOV
277
    reconnect();
×
UNCOV
278
  }
×
279
  virtual void reconnect() { }
×
280
  bool inTransaction() override
281
  {
1,022,976✔
282
    return d_inTransaction;
1,022,976✔
283
  }
1,022,976✔
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