Hello Drew,

On 23 May 2014, at 17:32 , Drew Decker <[email protected]> wrote:

> Anyone know what all the “%character” items are for PowerDNS?  
> 
> I’ve referencing:
> http://doc.powerdns.com/html/generic-mypgsql-backends.html#idp9683232
> 
> If you look at "basic-query”, it reads:
> 
> Default: select content,ttl,prio,type,domain_id,name from records where 
> type='%s' and name='%s' This is the most used query, needed for doing 1:1 
> lookups of qtype/name values. First %s is replaced by the ASCII 
> representation of the qtype of the question, the second by the name. 
> I need to know what the %x is for “id” (not “domain_id”, just “id”).  The 
> reason is, I would like to have it do some additional thing, that requires me 
> to know the actual ID of query.

Right now, the meaning of each %s is fixed, and determined by the order in the 
query.

From the code:

  d_NoIdQuery=getArg("basic-query”);
  d_IdQuery=getArg("id-query");
…
    if(domain_id < 0) {
      query = (boost::format(d_NoIdQuery)
               % sqlEscape(qtype.getName())
               % sqlEscape(lcqname)
        ).str();
    } else {
      query = (boost::format(d_IdQuery)
               % sqlEscape(qtype.getName())
               % sqlEscape(lcqname)
               % domain_id
        ).str();
    }
This applies type and lcqname (the lowercased query name) to the %s items in 
the query, in that order. You cannot change this without editing gsqlbackend.cc 
and recompiling, right now.

Note that -if- PowerDNS has a domain_id, it will use d_IdQuery (which you know 
as id-query), as also seen in the code above. So for your situation, changing 
id-query may be enough.

Kind regards,
-- 
Peter van Dijk
Netherlabs Computer Consulting BV - http://www.netherlabs.nl/

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
Pdns-users mailing list
[email protected]
http://mailman.powerdns.com/mailman/listinfo/pdns-users

Reply via email to