List:General Discussion« Previous MessageNext Message »
From:Thorsten Heymann Date:September 6 2010 1:27pm
Subject:AW: Dup Key Error Messages
View as plain text  
Not the answer I hoped to get but, thanks Carsten!

-----Ursprüngliche Nachricht-----
Von: Carsten Pedersen [mailto:carsten@stripped] 
Gesendet: Montag, 6. September 2010 15:17
An: Thorsten Heymann
Betreff: Re: Dup Key Error Messages

On Mon, 6 Sep 2010 15:02:24 +0200, Thorsten Heymann <>
> Digging through mysqld source, I found this behaviour handled in
> sql/ and changed from printing key_nr to between this
> versions. :(
> Is there a possible better, reliable way to detect what key is
> as searching in the error message?

Not really. And to make matters worse, this isn't just a version issue.
You'd have the same type of problems if your app connects to a server
installed with a non-Enlish language pack. 

The only reliable thing I can think of is to detect that you got an error
1062, then do a db search to find out which field or fields have duplicate
information. Cumbersome, but OTOH you'd also get a chance to realize if
more than one key field is duped. 

/ Carsten

Dup Key Error MessagesThorsten Heymann6 Sep
  • Re: Dup Key Error MessagesTompkins Neil6 Sep
    • AW: Dup Key Error MessagesThorsten Heymann6 Sep
      • Re: AW: Dup Key Error MessagesMySQL)6 Sep
  • Re: Dup Key Error MessagesCarsten Pedersen6 Sep
    • AW: Dup Key Error MessagesThorsten Heymann6 Sep
  • Re: Dup Key Error MessagesJoerg Bruehe6 Sep
    • AW: Dup Key Error MessagesThorsten Heymann7 Sep
      • Re: AW: Dup Key Error MessagesChris W7 Sep