Bug #10143 Perror not showing error description
Submitted: 25 Apr 2005 14:50 Modified: 12 Aug 2008 18:39
Reporter: [ name withheld ] (Basic Quality Contributor)
Status: Closed
Category:Server: Errors Severity:S3 (Non-critical)
Version:4.0, 4.1, 5.0 OS:Any (*)
Assigned to: Marc Alff Target Version:
Tags: usability, qc
Triage: D4 (Minor)

[25 Apr 2005 14:50] [ name withheld ]
Description:
I got this error back from MySQL:

ERROR 1062 (23000): Duplicate entry '...' for key 1

Perror seems unable to describe this error.

How to repeat:
Try running:

C:\>perror 1062
Illegal error code: 1062

I also tried the following in doubt of which was the right number:

C:\>perror 23000
Illegal error code: 23000
[7 Apr 2006 23:37] Hartmut Holzgraefe
this is a general problem: perror does not know about the error codes >=1000
i find myself using grep ever so often to look them up, it's a real shame that 
perror is not able to help with this rather simple task ... :(
[25 Jan 2007 13:14] Hartmut Holzgraefe
see also bug 25177
[1 Mar 2007 0:33] Chad MILLER
I planned to put all error codes in extras/perror.c and have perror the program dump a
stream of C++ "#define"s when given a certain parameter.

Execute it, redirecting to a file that the server uses.

Here's a patch that is 80% done, but needs some dependency problems worked out first.
[1 Mar 2007 0:34] Chad MILLER
Chad's first pass at a solution.  Needs a tiny amount of work.

Attachment: p (application/octet-stream, text), 14.78 KiB.

[30 Jun 2007 2:36] Miguel Solorzano
Still happens:

[miguel@light 5.0]$ bin/perror 1062
Illegal error code: 1062
[9 Oct 2007 18:41] Jeffrey Pugh
Other perror bugs:  bug #23028,#30003, #25177
[6 Aug 2008 1:26] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/50969

2745 Marc Alff	2008-08-05
      Bug#10143 (Perror not showing error description)
      
      Before this fix, errors described in sql/share/errmsg.txt were not
      displayed by the perror utility.
      
      With this fix, perror now is aware of these errors.
      
      Fixed the code generation for include/mysqld_ername.h to add the error
      message text.
      
      Fixed perror to lookup errors in include/mysqld_ername.h.
      
      Note that since the code is automatically generated,
      any new error created in sql/share/errmsg.txt (the source code)
      will be automatically recognized by perror, preventing the perror utility
      to get out of sync with the main source code.
[6 Aug 2008 14:57] Chad MILLER
Revno 2745 is good with me.  The capitalized "ER" in the function name may bother others,
but I think it's okay.
[7 Aug 2008 0:16] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/51046

2748 Marc Alff	2008-08-06
      Bug#10143
      
      Fixed the test result for ndb_basic, which is using perror.
[7 Aug 2008 0:17] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/51047

2748 Marc Alff	2008-08-06
      Bug#10143
      
      Fixed the test result for ndb_basic, which is using perror.
[7 Aug 2008 20:38] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/51138

2744 Marc Alff	2008-08-07 [merge]
      Merge mysql-6.0-bugteam -> local bugfix branch
[11 Aug 2008 16:56] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/51322

2765 Davi Arnaut	2008-08-11 [merge]
      Merge mysql-6.0-bugteam into mysql-6.0 main.
[12 Aug 2008 16:19] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/51420

2765 Davi Arnaut	2008-08-12 [merge]
      Merge mysql-6.0-bugteam into mysql-6.0 main.
[12 Aug 2008 16:26] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/51423

2765 Davi Arnaut	2008-08-12 [merge]
      Merge mysql-6.0-bugteam into mysql-6.0 main.
[12 Aug 2008 16:36] Bugs System
Pushed into 6.0.7-alpha  (revid:marc.alff@sun.com-20080806221607-m7q3g7gm144z9smp)
(version source revid:davi.arnaut@sun.com-20080812141852-8e6knbqclpfd8irn) (pib:3)
[12 Aug 2008 18:39] Paul DuBois
Noted in 6.0.7 changelog.

perror did not work for errors described in the sql/share/errmsg.txt
file.
[14 Aug 2008 9:32] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/51602

2684 He Zhenxing	2008-08-14 [merge]
      Merge 6.0 -> 6.0-rpl-testfixes
[14 Aug 2008 9:36] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/51603

2684 He Zhenxing	2008-08-14 [merge]
      Merge 6.0 -> 6.0-rpl-testfixes
[28 Aug 2008 22:14] Bugs System
Pushed into 6.0.7-alpha  (revid:cbell@mysql.com-20080822132131-uveo6wiuecy6m2b8) (version
source revid:cbell@mysql.com-20080822132131-uveo6wiuecy6m2b8) (pib:3)
[14 Sep 2008 2:53] Bugs System
Pushed into 6.0.7-alpha  (revid:marc.alff@sun.com-20080806221607-m7q3g7gm144z9smp)
(version source revid:vvaintroub@mysql.com-20080804094710-jb2qpqxpf2ir2gf3) (pib:3)