Re: [Pdns-users] PowerDNS needs your thoughts on two important DNSSEC matters

2012-09-04 Thread Peter van Dijk
Hello Erkan,

On Sep 4, 2012, at 11:34 , erkan yanar wrote:

> On Mon, Sep 03, 2012 at 07:19:45PM +0200, Peter van Dijk wrote:

>> OUR QUESTIONS:
>> 1b. Is VARBINARY the best way to do it for MySQL?
> 
> Afaik you want only to have the ordering (collation) to be binary. So you 
> have some ways to do it without touching the character set.
> 1. SELECT .. ORDER BY BINARY
>   Just change the Query

This, presumably, rules out index usage, which is bad.

> 2. ALTER TABLE records ADD order name  VARCHAR(255) BINARY
>   Then you don't care about the CHARSET used by the server. 
>   This syntax always set the binary collation specific for that charset


This is a good tip I did not know about. I will look into this. The downside of 
VARBINARY is that queries also become case-sensitive, which is acceptable for 
PowerDNS but makes debugging harder. Thanks!

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

___
Pdns-users mailing list
Pdns-users@mailman.powerdns.com
http://mailman.powerdns.com/mailman/listinfo/pdns-users


Re: [Pdns-users] PowerDNS needs your thoughts on two important DNSSEC matters

2012-09-04 Thread erkan yanar
On Mon, Sep 03, 2012 at 07:19:45PM +0200, Peter van Dijk wrote:
> Hello,
> 
> we are working hard to get 3.1.1 out the door, fixing the last remaining 
> DNSSEC issues. Since 3.1, we have discovered two issues that require some 
> re-engineering and may have database impact. We could really use some input 
> on these issues.
> 
> 
> ISSUE 1: ordername sorting
> 
[snip]
> 
> MySQL, depending on charset settings (cannot reproduce right now), will also 
> not do the right thing for us. However, for MySQL there are a few reliable 
> workarounds:
> ALTER TABLE records ADD order name  VARCHAR(255) COLLATE latin1_bin;
> or
> ALTER TABLE records ADD order name  VARBINARY(255);
> 
> Both of these will make order name sort correctly - the first one applies 
> when latin1 is already active, the second one is generic.
> 
> SQLite mostly seems to do the right thing, at least with default settings.
> 
> OUR QUESTIONS:
> 1b. Is VARBINARY the best way to do it for MySQL?

Afaik you want only to have the ordering (collation) to be binary. So you have 
some ways to do it without touching the character set.
1. SELECT .. ORDER BY BINARY
   Just change the Query
2. ALTER TABLE records ADD order name  VARCHAR(255) BINARY
   Then you don't care about the CHARSET used by the server. 
   This syntax always set the binary collation specific for that charset

Regards
Erkan


-- 
über den grenzen muß die freiheit wohl wolkenlos sein
___
Pdns-users mailing list
Pdns-users@mailman.powerdns.com
http://mailman.powerdns.com/mailman/listinfo/pdns-users