]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Remove superfluous gsql query for ENTs
authorPieter Lexis <pieter.lexis@powerdns.com>
Mon, 14 Dec 2015 11:34:43 +0000 (12:34 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 24 Feb 2016 14:51:06 +0000 (15:51 +0100)
This fixes part of #3024

docs/markdown/authoritative/backend-generic-sql.md
modules/gmysqlbackend/gmysqlbackend.cc
modules/godbcbackend/godbcbackend.cc
modules/goraclebackend/goraclebackend.cc
modules/gpgsqlbackend/gpgsqlbackend.cc
modules/gsqlite3backend/gsqlite3backend.cc
pdns/backends/gsql/gsqlbackend.cc
pdns/backends/gsql/gsqlbackend.hh

index 739e08de6a627d53d35794a933eecff60bc543b4..63d988497d5a13ed6cb3b18451f10849da540d0f 100644 (file)
@@ -180,9 +180,7 @@ These queries are used by e.g. `pdnsutil rectify-zone`. Make sure to read
 [Rules for filling out fields in database backends](dnssec.md#rules-for-filling-out-fields-in-database-backends)
 if you wish to calculate ordername and auth without using pdns-rectify.
 
-- `insert-ent-query`: Insert empty non-terminal in zone.
-- `insert-empty-non-terminal-query`: Insert empty non-terminal in zone.
-- `insert-ent-order-query`: Insert empty non-terminal in zone with the ordername set.
+- `insert-empty-non-terminal-order--query`: Insert empty non-terminal in zone.
 - `delete-empty-non-terminal-query`: Delete an empty non-terminal in a zone.
 - `remove-empty-non-terminals-from-zone-query`: remove all empty non-terminals from zone.
 
index 434ffcaa6bceccfd143ba314500046218250696e..e14e99e8de9f5ad6b8a56dbb998a9eaececcde62 100644 (file)
@@ -64,7 +64,6 @@ public:
     declare(suffix, "list-subzone-query", "Subzone listing", record_query+" disabled=0 and (name=? OR name like ?) and domain_id=?");
 
     declare(suffix, "remove-empty-non-terminals-from-zone-query", "remove all empty non-terminals from zone", "delete from records where domain_id=? and type is null");
-    declare(suffix, "insert-empty-non-terminal-query", "insert empty non-terminal in zone", "insert into records (domain_id,name,type,disabled,auth) values (?,?,null,0,1)");
     declare(suffix, "delete-empty-non-terminal-query", "delete empty non-terminal from zone", "delete from records where domain_id=? and name=? and type is null");
 
     declare(suffix,"master-zone-query","Data", "select master from domains where name=? and type='SLAVE'");
@@ -80,8 +79,7 @@ public:
 
     declare(suffix, "insert-record-query", "", "insert into records (content,ttl,prio,type,domain_id,disabled,name,auth) values (?,?,?,?,?,?,?,?)");
     declare(suffix, "insert-record-order-query", "", "insert into records (content,ttl,prio,type,domain_id,disabled,name,ordername,auth) values (?,?,?,?,?,?,?,?,?)");
-    declare(suffix, "insert-ent-query", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name,auth) values (null,?,0,?,?)");
-    declare(suffix, "insert-ent-order-query", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name,ordername,auth) values (null,?,0,?,?,?)");
+    declare(suffix, "insert-empty-non-terminal-order-query", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name,ordername,auth) values (null,?,0,?,?,?)");
 
     declare(suffix, "get-order-first-query", "DNSSEC Ordering Query, first", "select ordername from records where domain_id=? and disabled=0 and ordername is not null order by 1 asc limit 1");
     declare(suffix, "get-order-before-query", "DNSSEC Ordering Query, before", "select ordername, name from records where ordername <= ? and domain_id=? and disabled=0 and ordername is not null order by 1 desc limit 1");
index 4d787046f31cafffbd9af9f44e0d824c8d44d49c..6c73fce114da45a5298e0c555371aed88621c35f 100644 (file)
@@ -62,7 +62,6 @@ public:
     declare(suffix, "list-subzone-query", "Subzone listing", record_query+" disabled=0 and (name=? OR name like ?) and domain_id=?");
 
     declare(suffix, "remove-empty-non-terminals-from-zone-query", "remove all empty non-terminals from zone", "delete from records where domain_id=? and type is null");
-    declare(suffix, "insert-empty-non-terminal-query", "insert empty non-terminal in zone", "insert into records (domain_id,name,type,disabled,auth) values (?,?,null,0,1)");
     declare(suffix, "delete-empty-non-terminal-query", "delete empty non-terminal from zone", "delete from records where domain_id=? and name=? and type is null");
 
     declare(suffix,"master-zone-query","Data", "select master from domains where name=? and type='SLAVE'");
@@ -78,8 +77,7 @@ public:
 
     declare(suffix, "insert-record-query", "", "insert into records (content,ttl,prio,type,domain_id,disabled,name,auth) values (?,?,?,?,?,?,?,?)");
     declare(suffix, "insert-record-order-query", "", "insert into records (content,ttl,prio,type,domain_id,disabled,name,ordername,auth) values (?,?,?,?,?,?,?,convert(varbinary(255),?),?)");
-    declare(suffix, "insert-ent-query", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name,auth) values (null,?,0,?,?)");
-    declare(suffix, "insert-ent-order-query", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name,ordername,auth) values (null,?,0,?,convert(varbinary(255),?),?)");
+    declare(suffix, "insert-empty-non-terminal-order-query", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name,ordername,auth) values (null,?,0,?,convert(varbinary(255),?),?)");
 
     declare(suffix, "get-order-first-query", "DNSSEC Ordering Query, first", "select top 1 convert(varchar(255), ordername) from records where domain_id=? and disabled=0 and ordername is not null order by 1 asc");
     declare(suffix, "get-order-before-query", "DNSSEC Ordering Query, before", "select top 1 convert(varchar(255), ordername), name from records where ordername <= convert(varbinary(255),?) and domain_id=? and disabled=0 and ordername is not null order by 1 desc");
index 5414a66afe1564de18b999d1d7ec2e4574668fd4..d7d495c2b29a4d150304cc2c38f3512645a33156 100644 (file)
@@ -79,7 +79,6 @@ public:
     declare(suffix, "list-subzone-query", "Subzone listing", record_query+" disabled=0 and (name=:zone OR name like :wildzone) and domain_id=:domain_id");
 
     declare(suffix, "remove-empty-non-terminals-from-zone-query", "remove all empty non-terminals from zone", "delete from records where domain_id=:domain_id and type is null");
-    declare(suffix, "insert-empty-non-terminal-query", "insert empty non-terminal in zone", "insert into records (id,domain_id,name,type,disabled,auth) values (records_id_sequence.nextval,:domain_id,:qname,null,0,'1')");
     declare(suffix, "delete-empty-non-terminal-query", "delete empty non-terminal from zone", "delete from records where domain_id=:domain_id and name=:qname and type is null");
 
     declare(suffix, "master-zone-query", "Data", "select master from domains where name=:domain and type='SLAVE'");
@@ -93,8 +92,7 @@ public:
     declare(suffix, "insert-slave-query", "", "insert into domains (id,type,name,master,account) values(domains_id_sequence.nextval,'SLAVE',:domain,:masters,:account)");
     declare(suffix, "insert-record-query", "", "insert into records (id,content,ttl,prio,type,domain_id,disabled,name,auth) values (records_id_sequence.nextval,:content,:ttl,:priority,:qtype,:domain_id,:disabled,:qname,:auth)");
     declare(suffix, "insert-record-order-query", "", "insert into records (id,content,ttl,prio,type,domain_id,disabled,name,ordername,auth) values (records_id_sequence.nextval,:content,:ttl,:priority,:qtype,:domain_id,:disabled,:qname,:ordername || ' ',:auth)");
-    declare(suffix, "insert-ent-query", "insert empty non-terminal in zone", "insert into records (id,type,domain_id,disabled,name,auth) values (records_id_sequence.nextval,null,:domain_id,0,:qname,:auth)");
-    declare(suffix, "insert-ent-order-query", "insert empty non-terminal in zone", "insert into records (id,type,domain_id,disabled,name,ordername,auth) values (records_id_sequence.nextval,null,:domain_id,0,:qname,:ordername,:auth)");
+    declare(suffix, "insert-empty-non-terminal-order-query", "insert empty non-terminal in zone", "insert into records (id,type,domain_id,disabled,name,ordername,auth) values (records_id_sequence.nextval,null,:domain_id,0,:qname,:ordername,:auth)");
 
     declare(suffix, "get-order-first-query", "DNSSEC Ordering Query, first", "select * FROM (select trim(ordername) from records where disabled=0 and domain_id=:domain_id and ordername is not null order by ordername asc) where rownum=1");
     declare(suffix, "get-order-before-query", "DNSSEC Ordering Query, before", "select * FROM (select trim(ordername), name from records where disabled=0 and ordername <= :ordername || ' ' and domain_id=:domain_id and ordername is not null order by ordername desc) where rownum=1");
index 832f9a90fc473258107ce83ec1cbe9fbb59a3f14..9822bbd908346270b02c7f3d86ebd589bfe67c62 100644 (file)
@@ -59,7 +59,6 @@ public:
     declare(suffix, "list-subzone-query", "Subzone listing", record_query+" disabled=false and (name=$1 OR name like $2) and domain_id=$3");
 
     declare(suffix,"remove-empty-non-terminals-from-zone-query", "remove all empty non-terminals from zone", "delete from records where domain_id=$1 and type is null");
-    declare(suffix, "insert-empty-non-terminal-query", "insert empty non-terminal in zone", "insert into records (domain_id,name,type,disabled,auth) values ($1,$2,null,false,true)");
     declare(suffix,"delete-empty-non-terminal-query", "delete empty non-terminal from zone", "delete from records where domain_id=$1 and name=$2 and type is null");
 
     declare(suffix,"master-zone-query","Data", "select master from domains where name=$1 and type='SLAVE'");
@@ -75,8 +74,7 @@ public:
 
     declare(suffix, "insert-record-query", "", "insert into records (content,ttl,prio,type,domain_id,disabled,name,auth) values ($1,$2,$3,$4,$5,$6,$7,$8)");
     declare(suffix, "insert-record-order-query", "", "insert into records (content,ttl,prio,type,domain_id,disabled,name,ordername,auth) values ($1,$2,$3,$4,$5,$6,$7,$8,$9)");
-    declare(suffix, "insert-ent-query", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name,auth) values (null,$1,false,$2,$3)");
-    declare(suffix, "insert-ent-order-query", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name,ordername,auth) values (null,$1,false,$2,$3,$4)");
+    declare(suffix, "insert-empty-non-terminal-order-query", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name,ordername,auth) values (null,$1,false,$2,$3,$4)");
 
     declare(suffix, "get-order-first-query", "DNSSEC Ordering Query, last", "select ordername from records where disabled=false and domain_id=$1 and ordername is not null order by 1 using ~<~ limit 1");
     declare(suffix, "get-order-before-query", "DNSSEC Ordering Query, before", "select ordername, name from records where disabled=false and ordername ~<=~ $1 and domain_id=$2 and ordername is not null order by 1 using ~>~ limit 1");
index a764d8eedc3df07932e46aff77a2fc5d2fc3ce8d..5f36707b2a61d1af636c74f777ff98477fc2f043 100644 (file)
@@ -75,7 +75,6 @@ public:
     declare(suffix, "list-subzone-query", "Subzone listing", record_query+" disabled=0 and (name=:zone OR name like :wildzone) and domain_id=:domain_id");
 
     declare(suffix, "remove-empty-non-terminals-from-zone-query", "remove all empty non-terminals from zone", "delete from records where domain_id=:domain_id and type is null");
-    declare(suffix, "insert-empty-non-terminal-query", "insert empty non-terminal in zone", "insert into records (domain_id,name,type,disabled,auth) values (:domain_id,:qname,null,0,'1')");
     declare(suffix, "delete-empty-non-terminal-query", "delete empty non-terminal from zone", "delete from records where domain_id=:domain_id and name=:qname and type is null");
     
     declare(suffix, "master-zone-query", "Data", "select master from domains where name=:domain and type='SLAVE'");
@@ -91,8 +90,7 @@ public:
 
     declare(suffix, "insert-record-query", "", "insert into records (content,ttl,prio,type,domain_id,disabled,name,auth) values (:content,:ttl,:priority,:qtype,:domain_id,:disabled,:qname,:auth)");
     declare(suffix, "insert-record-order-query", "", "insert into records (content,ttl,prio,type,domain_id,disabled,name,ordername,auth) values (:content,:ttl,:priority,:qtype,:domain_id,:disabled,:qname,:ordername,:auth)");
-    declare(suffix, "insert-ent-query", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name,auth) values (null,:domain_id,0,:qname,:auth)");
-    declare(suffix, "insert-ent-order-query", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name,ordername,auth) values (null,:domain_id,0,:qname,:ordername,:auth)");
+    declare(suffix, "insert-empty-non-terminal-order-query", "insert empty non-terminal in zone", "insert into records (type,domain_id,disabled,name,ordername,auth) values (null,:domain_id,0,:qname,:ordername,:auth)");
 
     declare(suffix, "get-order-first-query", "DNSSEC Ordering Query, first", "select ordername from records where disabled=0 and domain_id=:domain_id and ordername is not null order by 1 asc limit 1");
     declare(suffix, "get-order-before-query", "DNSSEC Ordering Query, before", "select ordername, name from records where disabled=0 and ordername <= :ordername and domain_id=:domain_id and ordername is not null order by 1 desc limit 1");
index e6322e789f21afe2c6eef99f4cc2214f2088ce1e..7d97153a23fea60227fccd347d537338d9659d33 100644 (file)
@@ -71,7 +71,6 @@ GSQLBackend::GSQLBackend(const string &mode, const string &suffix)
   d_InsertZoneQuery=getArg("insert-zone-query");
   d_InsertSlaveZoneQuery=getArg("insert-slave-query");
   d_InsertRecordQuery=getArg("insert-record-query");
-  d_InsertEntQuery=getArg("insert-ent-query");
   d_UpdateMasterOfZoneQuery=getArg("update-master-query");
   d_UpdateKindOfZoneQuery=getArg("update-kind-query");
   d_UpdateSerialOfZoneQuery=getArg("update-serial-query");
@@ -85,9 +84,9 @@ GSQLBackend::GSQLBackend(const string &mode, const string &suffix)
   d_DeleteNamesQuery=getArg("delete-names-query");
   d_getAllDomainsQuery=getArg("get-all-domains-query");
 
-  d_removeEmptyNonTerminalsFromZoneQuery = getArg("remove-empty-non-terminals-from-zone-query");
-  d_insertEmptyNonTerminalQuery = getArg("insert-empty-non-terminal-query");
-  d_deleteEmptyNonTerminalQuery = getArg("delete-empty-non-terminal-query");
+  d_InsertEmptyNonTerminalOrderQuery=getArg("insert-empty-non-terminal-order-query");
+  d_DeleteEmptyNonTerminalQuery = getArg("delete-empty-non-terminal-query");
+  d_RemoveEmptyNonTerminalsFromZoneQuery = getArg("remove-empty-non-terminals-from-zone-query");
 
   d_ListCommentsQuery = getArg("list-comments-query");
   d_InsertCommentQuery = getArg("insert-comment-query");
@@ -95,7 +94,6 @@ GSQLBackend::GSQLBackend(const string &mode, const string &suffix)
   d_DeleteCommentsQuery = getArg("delete-comments-query");
 
   d_InsertRecordOrderQuery=getArg("insert-record-order-query");
-  d_InsertEntOrderQuery=getArg("insert-ent-order-query");
 
   d_firstOrderQuery = getArg("get-order-first-query");
   d_beforeOrderQuery = getArg("get-order-before-query");
@@ -146,9 +144,8 @@ GSQLBackend::GSQLBackend(const string &mode, const string &suffix)
   d_InsertZoneQuery_stmt = NULL;
   d_InsertSlaveZoneQuery_stmt = NULL;
   d_InsertRecordQuery_stmt = NULL;
-  d_InsertEntQuery_stmt = NULL;
   d_InsertRecordOrderQuery_stmt = NULL;
-  d_InsertEntOrderQuery_stmt = NULL;
+  d_InsertEmptyNonTerminalOrderQuery_stmt = NULL;
   d_UpdateMasterOfZoneQuery_stmt = NULL;
   d_UpdateKindOfZoneQuery_stmt = NULL;
   d_UpdateSerialOfZoneQuery_stmt = NULL;
@@ -168,9 +165,8 @@ GSQLBackend::GSQLBackend(const string &mode, const string &suffix)
   d_updateOrderNameAndAuthTypeQuery_stmt = NULL;
   d_nullifyOrderNameAndUpdateAuthQuery_stmt = NULL;
   d_nullifyOrderNameAndUpdateAuthTypeQuery_stmt = NULL;
-  d_removeEmptyNonTerminalsFromZoneQuery_stmt = NULL;
-  d_insertEmptyNonTerminalQuery_stmt = NULL;
-  d_deleteEmptyNonTerminalQuery_stmt = NULL;
+  d_RemoveEmptyNonTerminalsFromZoneQuery_stmt = NULL;
+  d_DeleteEmptyNonTerminalQuery_stmt = NULL;
   d_AddDomainKeyQuery_stmt = NULL;
   d_ListDomainKeysQuery_stmt = NULL;
   d_GetAllDomainMetadataQuery_stmt = NULL;
@@ -521,7 +517,7 @@ bool GSQLBackend::updateEmptyNonTerminals(uint32_t domain_id, const DNSName& zon
 
   if(remove) {
     try {
-      d_removeEmptyNonTerminalsFromZoneQuery_stmt->
+      d_RemoveEmptyNonTerminalsFromZoneQuery_stmt->
         bind("domain_id", domain_id)->
         execute()->
         reset();
@@ -535,7 +531,7 @@ bool GSQLBackend::updateEmptyNonTerminals(uint32_t domain_id, const DNSName& zon
   {
     for(const auto& qname: erase) {
       try {
-        d_deleteEmptyNonTerminalQuery_stmt->
+        d_DeleteEmptyNonTerminalQuery_stmt->
           bind("domain_id", domain_id)->
           bind("qname", qname)->
           execute()->
@@ -550,9 +546,11 @@ bool GSQLBackend::updateEmptyNonTerminals(uint32_t domain_id, const DNSName& zon
 
   for(const auto& qname: insert) {
     try {
-      d_insertEmptyNonTerminalQuery_stmt->
+      d_InsertEmptyNonTerminalOrderQuery_stmt->
         bind("domain_id", domain_id)->
         bind("qname", qname)->
+        bindNull("ordername")->
+        bind("auth", true)->
         execute()->
         reset();
     }
@@ -1353,9 +1351,10 @@ bool GSQLBackend::feedEnts(int domain_id, map<DNSName,bool>& nonterm)
 
   for(const auto& nt: nonterm) {
     try {
-      d_InsertEntQuery_stmt->
+      d_InsertEmptyNonTerminalOrderQuery_stmt->
         bind("domain_id",domain_id)->
         bind("qname", nt.first)->
+        bindNull("ordername")->
         bind("auth",(nt.second || !d_dnssecQueries))->
         execute()->
         reset();
@@ -1377,23 +1376,21 @@ bool GSQLBackend::feedEnts3(int domain_id, const DNSName &domain, map<DNSName,bo
 
   for(const auto& nt: nonterm) {
     try {
-      if(narrow || !nt.second) {
-        d_InsertEntQuery_stmt->
-          bind("domain_id",domain_id)->
-          bind("qname", nt.first)->
-          bind("auth", nt.second)->
-          execute()->
-          reset();
+      d_InsertEmptyNonTerminalOrderQuery_stmt->
+        bind("domain_id",domain_id)->
+        bind("qname", nt.first);
+      if (narrow || !nt.second) {
+        d_InsertEmptyNonTerminalOrderQuery_stmt->
+          bindNull("ordername");
       } else {
         ordername=toBase32Hex(hashQNameWithSalt(ns3prc, nt.first));
-        d_InsertEntOrderQuery_stmt->
-          bind("domain_id",domain_id)->
-          bind("qname", nt.first)->
-          bind("ordername",ordername)->
-          bind("auth",nt.second)->
-          execute()->
-          reset();
+        d_InsertEmptyNonTerminalOrderQuery_stmt->
+          bind("ordername", ordername);
       }
+      d_InsertEmptyNonTerminalOrderQuery_stmt->
+        bind("auth",nt.second)->
+        execute()->
+        reset();
     }
     catch (SSqlException &e) {
       throw DBException("GSQLBackend unable to feed empty non-terminal: "+e.txtReason());
index 1b034c08236e6bfb8452f444c8774cb66f115175..fb55e0556e6339fdb599f21e494fdf6382d6154a 100644 (file)
@@ -45,9 +45,8 @@ public:
       d_InsertZoneQuery_stmt = d_db->prepare(d_InsertZoneQuery, 1);
       d_InsertSlaveZoneQuery_stmt = d_db->prepare(d_InsertSlaveZoneQuery, 3);
       d_InsertRecordQuery_stmt = d_db->prepare(d_InsertRecordQuery, 8);
-      d_InsertEntQuery_stmt = d_db->prepare(d_InsertEntQuery, 3);
       d_InsertRecordOrderQuery_stmt = d_db->prepare(d_InsertRecordOrderQuery, 9);
-      d_InsertEntOrderQuery_stmt = d_db->prepare(d_InsertEntOrderQuery, 4);
+      d_InsertEmptyNonTerminalOrderQuery_stmt = d_db->prepare(d_InsertEmptyNonTerminalOrderQuery, 4);
       d_UpdateMasterOfZoneQuery_stmt = d_db->prepare(d_UpdateMasterOfZoneQuery, 2);
       d_UpdateKindOfZoneQuery_stmt = d_db->prepare(d_UpdateKindOfZoneQuery, 2);
       d_UpdateAccountOfZoneQuery_stmt = d_db->prepare(d_UpdateAccountOfZoneQuery, 2);
@@ -67,9 +66,8 @@ public:
       d_updateOrderNameAndAuthTypeQuery_stmt = d_db->prepare(d_updateOrderNameAndAuthTypeQuery, 5);
       d_nullifyOrderNameAndUpdateAuthQuery_stmt = d_db->prepare(d_nullifyOrderNameAndUpdateAuthQuery, 3);
       d_nullifyOrderNameAndUpdateAuthTypeQuery_stmt = d_db->prepare(d_nullifyOrderNameAndUpdateAuthTypeQuery, 4);
-      d_removeEmptyNonTerminalsFromZoneQuery_stmt = d_db->prepare(d_removeEmptyNonTerminalsFromZoneQuery, 1);
-      d_insertEmptyNonTerminalQuery_stmt = d_db->prepare(d_insertEmptyNonTerminalQuery, 2);
-      d_deleteEmptyNonTerminalQuery_stmt = d_db->prepare(d_deleteEmptyNonTerminalQuery, 2);
+      d_RemoveEmptyNonTerminalsFromZoneQuery_stmt = d_db->prepare(d_RemoveEmptyNonTerminalsFromZoneQuery, 1);
+      d_DeleteEmptyNonTerminalQuery_stmt = d_db->prepare(d_DeleteEmptyNonTerminalQuery, 2);
       d_AddDomainKeyQuery_stmt = d_db->prepare(d_AddDomainKeyQuery, 4);
       d_ListDomainKeysQuery_stmt = d_db->prepare(d_ListDomainKeysQuery, 1);
       d_GetAllDomainMetadataQuery_stmt = d_db->prepare(d_GetAllDomainMetadataQuery, 1);
@@ -116,9 +114,8 @@ public:
     release(&d_InsertZoneQuery_stmt);
     release(&d_InsertSlaveZoneQuery_stmt);
     release(&d_InsertRecordQuery_stmt);
-    release(&d_InsertEntQuery_stmt);
     release(&d_InsertRecordOrderQuery_stmt);
-    release(&d_InsertEntOrderQuery_stmt);
+    release(&d_InsertEmptyNonTerminalOrderQuery_stmt);
     release(&d_UpdateMasterOfZoneQuery_stmt);
     release(&d_UpdateKindOfZoneQuery_stmt);
     release(&d_UpdateAccountOfZoneQuery_stmt);
@@ -138,9 +135,8 @@ public:
     release(&d_updateOrderNameAndAuthTypeQuery_stmt);
     release(&d_nullifyOrderNameAndUpdateAuthQuery_stmt);
     release(&d_nullifyOrderNameAndUpdateAuthTypeQuery_stmt);
-    release(&d_removeEmptyNonTerminalsFromZoneQuery_stmt);
-    release(&d_insertEmptyNonTerminalQuery_stmt);
-    release(&d_deleteEmptyNonTerminalQuery_stmt);
+    release(&d_RemoveEmptyNonTerminalsFromZoneQuery_stmt);
+    release(&d_DeleteEmptyNonTerminalQuery_stmt);
     release(&d_AddDomainKeyQuery_stmt);
     release(&d_ListDomainKeysQuery_stmt);
     release(&d_GetAllDomainMetadataQuery_stmt);
@@ -256,9 +252,8 @@ private:
   string d_InsertZoneQuery;
   string d_InsertSlaveZoneQuery;
   string d_InsertRecordQuery;
-  string d_InsertEntQuery;
   string d_InsertRecordOrderQuery;
-  string d_InsertEntOrderQuery;
+  string d_InsertEmptyNonTerminalOrderQuery;
   string d_UpdateMasterOfZoneQuery;
   string d_UpdateKindOfZoneQuery;
   string d_UpdateAccountOfZoneQuery;
@@ -281,9 +276,8 @@ private:
   string d_nullifyOrderNameAndUpdateAuthQuery;
   string d_nullifyOrderNameAndUpdateAuthTypeQuery;
 
-  string d_removeEmptyNonTerminalsFromZoneQuery;
-  string d_insertEmptyNonTerminalQuery;
-  string d_deleteEmptyNonTerminalQuery;
+  string d_RemoveEmptyNonTerminalsFromZoneQuery;
+  string d_DeleteEmptyNonTerminalQuery;
 
   string d_AddDomainKeyQuery;
   string d_ListDomainKeysQuery;
@@ -331,9 +325,8 @@ private:
   SSqlStatement* d_InsertZoneQuery_stmt;
   SSqlStatement* d_InsertSlaveZoneQuery_stmt;
   SSqlStatement* d_InsertRecordQuery_stmt;
-  SSqlStatement* d_InsertEntQuery_stmt;
   SSqlStatement* d_InsertRecordOrderQuery_stmt;
-  SSqlStatement* d_InsertEntOrderQuery_stmt;
+  SSqlStatement* d_InsertEmptyNonTerminalOrderQuery_stmt;
   SSqlStatement* d_UpdateMasterOfZoneQuery_stmt;
   SSqlStatement* d_UpdateKindOfZoneQuery_stmt;
   SSqlStatement* d_UpdateAccountOfZoneQuery_stmt;
@@ -353,9 +346,8 @@ private:
   SSqlStatement* d_updateOrderNameAndAuthTypeQuery_stmt;
   SSqlStatement* d_nullifyOrderNameAndUpdateAuthQuery_stmt;
   SSqlStatement* d_nullifyOrderNameAndUpdateAuthTypeQuery_stmt;
-  SSqlStatement* d_removeEmptyNonTerminalsFromZoneQuery_stmt;
-  SSqlStatement* d_insertEmptyNonTerminalQuery_stmt;
-  SSqlStatement* d_deleteEmptyNonTerminalQuery_stmt;
+  SSqlStatement* d_RemoveEmptyNonTerminalsFromZoneQuery_stmt;
+  SSqlStatement* d_DeleteEmptyNonTerminalQuery_stmt;
   SSqlStatement* d_AddDomainKeyQuery_stmt;
   SSqlStatement* d_ListDomainKeysQuery_stmt;
   SSqlStatement* d_GetAllDomainMetadataQuery_stmt;