]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
g*sql: put common query parts in a variable
authorChristian Hofstaedtler <christian@hofstaedtler.name>
Fri, 31 Jan 2014 17:13:21 +0000 (18:13 +0100)
committerChristian Hofstaedtler <christian@hofstaedtler.name>
Mon, 3 Feb 2014 15:08:35 +0000 (16:08 +0100)
modules/gmysqlbackend/gmysqlbackend.cc
modules/goraclebackend/goraclebackend.cc
modules/gpgsqlbackend/gpgsqlbackend.cc
modules/gsqlite3backend/gsqlite3backend.cc

index 566438077f76920bda285cadeb519dd460ae2da0..09b4e6ee4b9fd6b7ba328c344f01a9e9c63dbba2 100644 (file)
@@ -50,34 +50,37 @@ public:
 
     declare(suffix,"dnssec","Assume DNSSEC Schema is in place","no");
 
-    declare(suffix,"basic-query","Basic query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name='%s'");
-    declare(suffix,"id-query","Basic with ID query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name='%s' and domain_id=%d");
-    declare(suffix,"wildcard-query","Wildcard query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name like '%s'");
-    declare(suffix,"wildcard-id-query","Wildcard with ID query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name like '%s' and domain_id='%d'");
+    string record_query = "SELECT content,ttl,prio,type,domain_id,name FROM records WHERE 1";
+    string record_auth_query = "SELECT content,ttl,prio,type,domain_id,name,auth FROM records WHERE 1";
 
-    declare(suffix,"any-query","Any query","select content,ttl,prio,type,domain_id,name from records where name='%s'");
-    declare(suffix,"any-id-query","Any with ID query","select content,ttl,prio,type,domain_id,name from records where name='%s' and domain_id=%d");
-    declare(suffix,"wildcard-any-query","Wildcard ANY query","select content,ttl,prio,type,domain_id,name from records where name like '%s'");
-    declare(suffix,"wildcard-any-id-query","Wildcard ANY with ID query","select content,ttl,prio,type,domain_id,name from records where name like '%s' and domain_id='%d'");
+    declare(suffix, "basic-query", "Basic query", record_query+" and type='%s' and name='%s'");
+    declare(suffix, "id-query", "Basic with ID query", record_query+" and type='%s' and name='%s' and domain_id=%d");
+    declare(suffix, "wildcard-query", "Wildcard query", record_query+" and type='%s' and name like '%s'");
+    declare(suffix, "wildcard-id-query", "Wildcard with ID query", record_query+" and type='%s' and name like '%s' and domain_id='%d'");
 
-    declare(suffix,"list-query","AXFR query", "select content,ttl,prio,type,domain_id,name from records where domain_id='%d'");
+    declare(suffix, "any-query", "Any query", record_query+" and name='%s'");
+    declare(suffix, "any-id-query", "Any with ID query", record_query+" and name='%s' and domain_id=%d");
+    declare(suffix, "wildcard-any-query", "Wildcard ANY query", record_query+" and name like '%s'");
+    declare(suffix, "wildcard-any-id-query", "Wildcard ANY with ID query", record_query+" and name like '%s' and domain_id='%d'");
+
+    declare(suffix, "list-query", "AXFR query", record_query+" and domain_id='%d'");
 
     declare(suffix,"remove-empty-non-terminals-from-zone-query", "remove all empty non-terminals from zone", "delete from records where domain_id='%d' and type is null");
     declare(suffix,"insert-empty-non-terminal-query", "insert empty non-terminal in zone", "insert into records (domain_id,name,type) values ('%d','%s',null)");
     declare(suffix,"delete-empty-non-terminal-query", "delete empty non-terminal from zone", "delete from records where domain_id='%d' and name='%s' and type is null");
 
     // and now with auth
-    declare(suffix,"basic-query-auth","Basic query","select content,ttl,prio,type,domain_id,name, auth from records where type='%s' and name='%s'");
-    declare(suffix,"id-query-auth","Basic with ID query","select content,ttl,prio,type,domain_id,name, auth from records where type='%s' and name='%s' and domain_id=%d");
-    declare(suffix,"wildcard-query-auth","Wildcard query","select content,ttl,prio,type,domain_id,name, auth from records where type='%s' and name like '%s'");
-    declare(suffix,"wildcard-id-query-auth","Wildcard with ID query","select content,ttl,prio,type,domain_id,name, auth from records where type='%s' and name like '%s' and domain_id='%d'");
+    declare(suffix, "basic-query-auth", "Basic query", record_auth_query+" and type='%s' and name='%s'");
+    declare(suffix, "id-query-auth", "Basic with ID query", record_auth_query+" and type='%s' and name='%s' and domain_id=%d");
+    declare(suffix, "wildcard-query-auth", "Wildcard query", record_auth_query+" and type='%s' and name like '%s'");
+    declare(suffix, "wildcard-id-query-auth", "Wildcard with ID query", record_auth_query+" and type='%s' and name like '%s' and domain_id='%d'");
 
-    declare(suffix,"any-query-auth","Any query","select content,ttl,prio,type,domain_id,name, auth from records where name='%s'");
-    declare(suffix,"any-id-query-auth","Any with ID query","select content,ttl,prio,type,domain_id,name, auth from records where name='%s' and domain_id=%d");
-    declare(suffix,"wildcard-any-query-auth","Wildcard ANY query","select content,ttl,prio,type,domain_id,name, auth from records where name like '%s'");
-    declare(suffix,"wildcard-any-id-query-auth","Wildcard ANY with ID query","select content,ttl,prio,type,domain_id,name, auth from records where name like '%s' and domain_id='%d'");
+    declare(suffix, "any-query-auth", "Any query", record_auth_query+" and name='%s'");
+    declare(suffix, "any-id-query-auth", "Any with ID query", record_auth_query+" and name='%s' and domain_id=%d");
+    declare(suffix, "wildcard-any-query-auth", "Wildcard ANY query", record_auth_query+" and name like '%s'");
+    declare(suffix, "wildcard-any-id-query-auth", "Wildcard ANY with ID query", record_auth_query+" and name like '%s' and domain_id='%d'");
 
-    declare(suffix,"list-query-auth","AXFR query", "select content,ttl,prio,type,domain_id,name, auth from records where domain_id='%d' order by name, type");
+    declare(suffix, "list-query-auth", "AXFR query", record_auth_query+" and domain_id='%d' order by name, type");
 
     declare(suffix,"insert-empty-non-terminal-query-auth", "insert empty non-terminal in zone", "insert into records (domain_id,name,type,auth) values ('%d','%s',null,'1')");
 
index 61d86f901a2f87e610addb6302bad902edfa6bfb..97cb701cc5593c157692db494d83b6eee6dfba48 100644 (file)
@@ -57,34 +57,37 @@ public:
 
     declare(suffix,"dnssec","Assume DNSSEC Schema is in place","no");
 
-    declare(suffix,"basic-query","Basic query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name='%s'");
-    declare(suffix,"id-query","Basic with ID query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name='%s' and domain_id=%d");
-    declare(suffix,"wildcard-query","Wildcard query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name like '%s'");
-    declare(suffix,"wildcard-id-query","Wildcard with ID query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name like '%s' and domain_id='%d'");
+    string record_query = "SELECT content,ttl,prio,type,domain_id,name FROM records WHERE 1";
+    string record_auth_query = "SELECT content,ttl,prio,type,domain_id,name,auth FROM records WHERE 1";
 
-    declare(suffix,"any-query","Any query","select content,ttl,prio,type,domain_id,name from records where name='%s'");
-    declare(suffix,"any-id-query","Any with ID query","select content,ttl,prio,type,domain_id,name from records where name='%s' and domain_id=%d");
-    declare(suffix,"wildcard-any-query","Wildcard ANY query","select content,ttl,prio,type,domain_id,name from records where name like '%s'");
-    declare(suffix,"wildcard-any-id-query","Wildcard ANY with ID query","select content,ttl,prio,type,domain_id,name from records where name like '%s' and domain_id='%d'");
+    declare(suffix, "basic-query", "Basic query", record_query+" and type='%s' and name='%s'");
+    declare(suffix, "id-query", "Basic with ID query", record_query+" and type='%s' and name='%s' and domain_id=%d");
+    declare(suffix, "wildcard-query", "Wildcard query", record_query+" and type='%s' and name like '%s'");
+    declare(suffix, "wildcard-id-query", "Wildcard with ID query", record_query+" and type='%s' and name like '%s' and domain_id='%d'");
 
-    declare(suffix,"list-query","AXFR query", "select content,ttl,prio,type,domain_id,name from records where domain_id='%d'");
+    declare(suffix, "any-query", "Any query", record_query+" and name='%s'");
+    declare(suffix, "any-id-query", "Any with ID query", record_query+" and name='%s' and domain_id=%d");
+    declare(suffix, "wildcard-any-query", "Wildcard ANY query", record_query+" and name like '%s'");
+    declare(suffix, "wildcard-any-id-query", "Wildcard ANY with ID query", record_query+" and name like '%s' and domain_id='%d'");
+
+    declare(suffix, "list-query", "AXFR query",  record_query+" and domain_id='%d'");
 
     declare(suffix,"remove-empty-non-terminals-from-zone-query", "remove all empty non-terminals from zone", "delete from records where domain_id='%d' 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) values (records_id_sequence.nextval,'%d','%s',null)");
     declare(suffix,"delete-empty-non-terminal-query", "delete empty non-terminal from zone", "delete from records where domain_id='%d' and name='%s' and type is null");
 
     // and now with auth
-    declare(suffix,"basic-query-auth","Basic query","select content,ttl,prio,type,domain_id,name, auth from records where type='%s' and name='%s'");
-    declare(suffix,"id-query-auth","Basic with ID query","select content,ttl,prio,type,domain_id,name, auth from records where type='%s' and name='%s' and domain_id=%d");
-    declare(suffix,"wildcard-query-auth","Wildcard query","select content,ttl,prio,type,domain_id,name, auth from records where type='%s' and name like '%s'");
-    declare(suffix,"wildcard-id-query-auth","Wildcard with ID query","select content,ttl,prio,type,domain_id,name, auth from records where type='%s' and name like '%s' and domain_id='%d'");
+    declare(suffix, "basic-query-auth", "Basic query", record_auth_query+" and type='%s' and name='%s'");
+    declare(suffix, "id-query-auth", "Basic with ID query", record_auth_query+" and type='%s' and name='%s' and domain_id=%d");
+    declare(suffix, "wildcard-query-auth", "Wildcard query", record_auth_query+" and type='%s' and name like '%s'");
+    declare(suffix, "wildcard-id-query-auth", "Wildcard with ID query", record_auth_query+" and type='%s' and name like '%s' and domain_id='%d'");
 
-    declare(suffix,"any-query-auth","Any query","select content,ttl,prio,type,domain_id,name, auth from records where name='%s'");
-    declare(suffix,"any-id-query-auth","Any with ID query","select content,ttl,prio,type,domain_id,name, auth from records where name='%s' and domain_id=%d");
-    declare(suffix,"wildcard-any-query-auth","Wildcard ANY query","select content,ttl,prio,type,domain_id,name, auth from records where name like '%s'");
-    declare(suffix,"wildcard-any-id-query-auth","Wildcard ANY with ID query","select content,ttl,prio,type,domain_id,name, auth from records where name like '%s' and domain_id='%d'");
+    declare(suffix, "any-query-auth", "Any query", record_auth_query+" and name='%s'");
+    declare(suffix, "any-id-query-auth", "Any with ID query", record_auth_query+" and name='%s' and domain_id=%d");
+    declare(suffix, "wildcard-any-query-auth", "Wildcard ANY query", record_auth_query+" and name like '%s'");
+    declare(suffix, "wildcard-any-id-query-auth", "Wildcard ANY with ID query", record_auth_query+" and name like '%s' and domain_id='%d'");
 
-    declare(suffix,"list-query-auth","AXFR query", "select content,ttl,prio,type,domain_id,name, auth from records where domain_id='%d' order by name, type");
+    declare(suffix, "list-query-auth", "AXFR query",  record_auth_query+" and domain_id='%d' order by name, type");
 
     declare(suffix,"insert-empty-non-terminal-query-auth", "insert empty non-terminal in zone", "insert into records (id,domain_id,name,type,auth) values (records_id_sequence.nextval,'%d','%s',null,'1')");
 
index a2125b14f43c84dfe131bd60c89df40c377b5a31..e4f2bdb542ba1e23da25672a2dfe90a40f1b0d42 100644 (file)
@@ -46,34 +46,37 @@ public:
 
     declare(suffix,"dnssec","Assume DNSSEC Schema is in place","no");
 
-    declare(suffix,"basic-query","Basic query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name=E'%s'");
-    declare(suffix,"id-query","Basic with ID query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name=E'%s' and domain_id=%d");
-    declare(suffix,"wildcard-query","Wildcard query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name like E'%s'");
-    declare(suffix,"wildcard-id-query","Wildcard with ID query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name like E'%s' and domain_id='%d'");
+    string record_query = "SELECT content,ttl,prio,type,domain_id,name FROM records WHERE 1";
+    string record_auth_query = "SELECT content,ttl,prio,type,domain_id,name,auth::int FROM records WHERE 1";
 
-    declare(suffix,"any-query","Any query","select content,ttl,prio,type,domain_id,name from records where name=E'%s'");
-    declare(suffix,"any-id-query","Any with ID query","select content,ttl,prio,type,domain_id,name from records where name=E'%s' and domain_id=%d");
-    declare(suffix,"wildcard-any-query","Wildcard ANY query","select content,ttl,prio,type,domain_id,name from records where name like E'%s'");
-    declare(suffix,"wildcard-any-id-query","Wildcard ANY with ID query","select content,ttl,prio,type,domain_id,name from records where name like E'%s' and domain_id='%d'");
+    declare(suffix, "basic-query", "Basic query", record_query+" and type='%s' and name=E'%s'");
+    declare(suffix, "id-query", "Basic with ID query", record_query+" and type='%s' and name=E'%s' and domain_id=%d");
+    declare(suffix, "wildcard-query", "Wildcard query", record_query+" and type='%s' and name like E'%s'");
+    declare(suffix, "wildcard-id-query", "Wildcard with ID query", record_query+" and type='%s' and name like E'%s' and domain_id='%d'");
 
-    declare(suffix,"list-query","AXFR query", "select content,ttl,prio,type,domain_id,name from records where domain_id='%d'");
+    declare(suffix, "any-query", "Any query", record_query+" and name=E'%s'");
+    declare(suffix, "any-id-query", "Any with ID query", record_query+" and name=E'%s' and domain_id=%d");
+    declare(suffix, "wildcard-any-query", "Wildcard ANY query", record_query+" and name like E'%s'");
+    declare(suffix, "wildcard-any-id-query", "Wildcard ANY with ID query", record_query+" and name like E'%s' and domain_id='%d'");
+
+    declare(suffix, "list-query", "AXFR query", record_query+" and domain_id='%d'");
 
     declare(suffix,"remove-empty-non-terminals-from-zone-query", "remove all empty non-terminals from zone", "delete from records where domain_id='%d' and type is null");
     declare(suffix,"insert-empty-non-terminal-query", "insert empty non-terminal in zone", "insert into records (domain_id,name,type) values ('%d','%s',null)");
     declare(suffix,"delete-empty-non-terminal-query", "delete empty non-terminal from zone", "delete from records where domain_id='%d' and name='%s' and type is null");
 
     // and now with auth
-    declare(suffix,"basic-query-auth","Basic query","select content,ttl,prio,type,domain_id,name,auth::int from records where type='%s' and name=E'%s'");
-    declare(suffix,"id-query-auth","Basic with ID query","select content,ttl,prio,type,domain_id,name,auth::int from records where type='%s' and name=E'%s' and domain_id=%d");
-    declare(suffix,"wildcard-query-auth","Wildcard query","select content,ttl,prio,type,domain_id,name,auth::int from records where type='%s' and name like E'%s'");
-    declare(suffix,"wildcard-id-query-auth","Wildcard with ID query","select content,ttl,prio,type,domain_id,name,auth::int from records where type='%s' and name like E'%s' and domain_id='%d'");
+    declare(suffix, "basic-query-auth", "Basic query", record_auth_query+" and type='%s' and name=E'%s'");
+    declare(suffix, "id-query-auth", "Basic with ID query", record_auth_query+" and type='%s' and name=E'%s' and domain_id=%d");
+    declare(suffix, "wildcard-query-auth", "Wildcard query", record_auth_query+" and type='%s' and name like E'%s'");
+    declare(suffix, "wildcard-id-query-auth", "Wildcard with ID query", record_auth_query+" and type='%s' and name like E'%s' and domain_id='%d'");
 
-    declare(suffix,"any-query-auth","Any query","select content,ttl,prio,type,domain_id,name, auth::int from records where name=E'%s'");
-    declare(suffix,"any-id-query-auth","Any with ID query","select content,ttl,prio,type,domain_id,name, auth::int from records where name=E'%s' and domain_id=%d");
-    declare(suffix,"wildcard-any-query-auth","Wildcard ANY query","select content,ttl,prio,type,domain_id,name, auth::int from records where name like E'%s'");
-    declare(suffix,"wildcard-any-id-query-auth","Wildcard ANY with ID query","select content,ttl,prio,type,domain_id,name, auth::int from records where name like E'%s' and domain_id='%d'");
+    declare(suffix, "any-query-auth", "Any query", record_auth_query+" and name=E'%s'");
+    declare(suffix, "any-id-query-auth", "Any with ID query", record_auth_query+" and name=E'%s' and domain_id=%d");
+    declare(suffix, "wildcard-any-query-auth", "Wildcard ANY query", record_auth_query+" and name like E'%s'");
+    declare(suffix, "wildcard-any-id-query-auth", "Wildcard ANY with ID query", record_auth_query+" and name like E'%s' and domain_id='%d'");
 
-    declare(suffix,"list-query-auth","AXFR query", "select content,ttl,prio,type,domain_id,name, auth::int from records where domain_id='%d' order by name, type");
+    declare(suffix, "list-query-auth", "AXFR query", record_auth_query+" and domain_id='%d' order by name, type");
 
     declare(suffix,"insert-empty-non-terminal-query-auth", "insert empty non-terminal in zone", "insert into records (domain_id,name,type,auth) values ('%d','%s',null,true)");
 
index 7415e3ed023e0d8611f59af71631e7389ecb756e..bdaa5faa4e7248506290a0b64e02733c227003fa 100644 (file)
@@ -57,35 +57,38 @@ public:
   {
     declare( suffix, "database", "Filename of the SQLite3 database", "powerdns.sqlite" );
     declare( suffix, "pragma-synchronous", "Set this to 0 for blazing speed", "" );
-    
-    declare( suffix, "basic-query", "Basic query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name='%s'");
-    declare( suffix, "id-query", "Basic with ID query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name='%s' and domain_id=%d");
-    declare( suffix, "wildcard-query", "Wildcard query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name like '%s'");
-    declare( suffix, "wildcard-id-query", "Wildcard with ID query","select content,ttl,prio,type,domain_id,name from records where type='%s' and name like '%s' and domain_id=%d");
 
-    declare( suffix, "any-query", "Any query","select content,ttl,prio,type,domain_id,name from records where name='%s'");
-    declare( suffix, "any-id-query", "Any with ID query","select content,ttl,prio,type,domain_id,name from records where name='%s' and domain_id=%d");
-    declare( suffix, "wildcard-any-query", "Wildcard ANY query","select content,ttl,prio,type,domain_id,name from records where name like '%s'");
-    declare( suffix, "wildcard-any-id-query", "Wildcard ANY with ID query","select content,ttl,prio,type,domain_id,name from records where name like '%s' and domain_id=%d");
+    string record_query = "SELECT content,ttl,prio,type,domain_id,name FROM records WHERE 1";
+    string record_auth_query = "SELECT content,ttl,prio,type,domain_id,name,auth FROM records WHERE 1";
+
+    declare(suffix, "basic-query", "Basic query", record_query+" and type='%s' and name='%s'");
+    declare(suffix, "id-query", "Basic with ID query", record_query+" and type='%s' and name='%s' and domain_id=%d");
+    declare(suffix, "wildcard-query", "Wildcard query", record_query+" and type='%s' and name like '%s'");
+    declare(suffix, "wildcard-id-query", "Wildcard with ID query", record_query+" and type='%s' and name like '%s' and domain_id=%d");
+
+    declare(suffix, "any-query", "Any query", record_query+" and name='%s'");
+    declare(suffix, "any-id-query", "Any with ID query", record_query+" and name='%s' and domain_id=%d");
+    declare(suffix, "wildcard-any-query", "Wildcard ANY query", record_query+" and name like '%s'");
+    declare(suffix, "wildcard-any-id-query", "Wildcard ANY with ID query", record_query+" and name like '%s' and domain_id=%d");
 
-    declare( suffix, "list-query", "AXFR query", "select content,ttl,prio,type,domain_id,name from records where domain_id=%d");
+    declare(suffix, "list-query", "AXFR query", record_query+" and domain_id=%d");
 
     declare(suffix,"remove-empty-non-terminals-from-zone-query", "remove all empty non-terminals from zone", "delete from records where domain_id='%d' and type is null");
     declare(suffix,"insert-empty-non-terminal-query", "insert empty non-terminal in zone", "insert into records (domain_id,name,type) values ('%d','%s',null)");
     declare(suffix,"delete-empty-non-terminal-query", "delete empty non-terminal from zone", "delete from records where domain_id='%d' and name='%s' and type is null");
     
     // and now with auth
-    declare(suffix,"basic-query-auth","Basic query","select content,ttl,prio,type,domain_id,name, auth from records where type='%s' and name='%s'");
-    declare(suffix,"id-query-auth","Basic with ID query","select content,ttl,prio,type,domain_id,name, auth from records where type='%s' and name='%s' and domain_id=%d");
-    declare(suffix,"wildcard-query-auth","Wildcard query","select content,ttl,prio,type,domain_id,name, auth from records where type='%s' and name like '%s'");
-    declare(suffix,"wildcard-id-query-auth","Wildcard with ID query","select content,ttl,prio,type,domain_id,name, auth from records where type='%s' and name like '%s' and domain_id='%d'");
+    declare(suffix, "basic-query-auth", "Basic query", record_auth_query+" and type='%s' and name='%s'");
+    declare(suffix, "id-query-auth", "Basic with ID query", record_auth_query+" and type='%s' and name='%s' and domain_id=%d");
+    declare(suffix, "wildcard-query-auth", "Wildcard query", record_auth_query+" and type='%s' and name like '%s'");
+    declare(suffix, "wildcard-id-query-auth", "Wildcard with ID query", record_auth_query+" and type='%s' and name like '%s' and domain_id='%d'");
 
-    declare(suffix,"any-query-auth","Any query","select content,ttl,prio,type,domain_id,name, auth from records where name='%s'");
-    declare(suffix,"any-id-query-auth","Any with ID query","select content,ttl,prio,type,domain_id,name, auth from records where name='%s' and domain_id=%d");
-    declare(suffix,"wildcard-any-query-auth","Wildcard ANY query","select content,ttl,prio,type,domain_id,name, auth from records where name like '%s'");
-    declare(suffix,"wildcard-any-id-query-auth","Wildcard ANY with ID query","select content,ttl,prio,type,domain_id,name, auth from records where name like '%s' and domain_id='%d'");
+    declare(suffix, "any-query-auth", "Any query", record_auth_query+" and name='%s'");
+    declare(suffix, "any-id-query-auth", "Any with ID query", record_auth_query+" and name='%s' and domain_id=%d");
+    declare(suffix, "wildcard-any-query-auth", "Wildcard ANY query", record_auth_query+" and name like '%s'");
+    declare(suffix, "wildcard-any-id-query-auth", "Wildcard ANY with ID query", record_auth_query+" and name like '%s' and domain_id='%d'");
 
-    declare(suffix,"list-query-auth","AXFR query", "select content,ttl,prio,type,domain_id,name, auth from records where domain_id='%d' order by name, type");
+    declare(suffix, "list-query-auth", "AXFR query", record_auth_query+" and domain_id='%d' order by name, type");
 
     declare(suffix,"insert-empty-non-terminal-query-auth", "insert empty non-terminal in zone", "insert into records (domain_id,name,type,auth) values ('%d','%s',null,'1')");