|
@@ -0,0 +1,30 @@
+diff -ru pdns-3.3-rc1/pdns/backends/gsql/gsqlbackend.cc pdns-3.3/pdns/backends/gsql/gsqlbackend.cc
+--- pdns/backends/gsql/gsqlbackend.cc 2013-05-17 15:05:20.000000000 +0200
++++ pdns/backends/gsql/gsqlbackend.cc 2013-06-12 14:19:19.934020614 +0200
+@@ -702,7 +702,7 @@
+
+ // lcqname=labelReverse(makeRelative(lcqname, "net"));
+
+- if(qtype.getCode()!=QType::ANY) {
++ if(qtype.getCode()!=QType::ANY && qtype.getCode()!=QType::CNAME) {
+ // qtype qname domain_id
+ if(domain_id<0) {
+ if(qname[0]=='%')
+@@ -720,6 +720,17 @@
+ snprintf(output,sizeof(output)-1, format.c_str(),sqlEscape(qtype.getName()).c_str(),sqlEscape(lcqname).c_str(),domain_id);
+ }
+ }
++ else if (qtype.getCode()==QType::CNAME)
++ {
++ if(domain_id<0) {
++ format=d_noWildCardNoIDQuery;
++ snprintf(output,sizeof(output)-1, format.c_str(),sqlEscape(qtype.getName()).c_str(),sqlEscape(lcqname).c_str());
++ }
++ else {
++ format=d_wildCardIDQuery;
++ snprintf(output,sizeof(output)-1, format.c_str(),sqlEscape(qtype.getName()).c_str(),sqlEscape(lcqname).c_str(),domain_id);
++ }
++ }
+ else {
+ // qtype==ANY
+ // qname domain_id
|