On 08-Jul-01 Michael Collins wrote:
> At 10:09 AM +0307 7/8/01, Tonu Samuel wrote:
>>Use the utility "perror" to get meaning of OS low level errors.
>
> I have taken a look at the perror utility for viewing the text for
> MySQL error codes and decided I wanted to see all the MySQL error
> messages so I created a simple PERL script:
>
>#!/usr/bin/perl
> $inc = 1;
> $err ='';
> do {
> $err = system "(/usr/local/bin/perror -v $inc;)";
> print "$err.\r";
> $inc++;
> } while ($err ne '')
>
> I am not a PERL coder at all, this is one of my first attempts. Can
> anyone suggest a good way to stop printing out the list, when there
> are no more errors to report on?
try em all | grep -v trash.
$ jot 4096 | xargs -n 16 perror | grep -v "Unknown error: "
> Error code 86: Bad CPU type in executable
> Error code 87: Shared library version mismatch
> Error code 88: Malformed Mach-o file
> Error code 89: Unknown error: 89
> Error code 90: Unknown error: 90
>
> and then keeps repeating but I get some odd results with two lines
> for error 120, 121, 123 and so on:
>
> Error code 119: Unknown error: 119
> Error code 120: Unknown error: 120
> 120 = Didn't find key on read or update
> Error code 121: Unknown error: 121
> 121 = Duplicate key on write or update
> Error code 122: Unknown error: 122
> Error code 123: Unknown error: 123
> 123 = Someone has changed the row since it was read; Update with is
> recoverable
> Error code 124: Unknown error: 124
> 124 = Wrong index given to function
> Error code 125: Unknown error: 125
> Error code 126: Unknown error: 126
> 126 = Index file is crashed / Wrong file format
> Error code 127: Unknown error: 127
> 127 = Record-file is crashed
> Error code 128: Unknown error: 128
> Error code 129: Unknown error: 129
> Error code 130: Unknown error: 130
> Error code 131: Unknown error: 131
> 131 = Command not supported by database
> Error code 132: Unknown error: 132
>
Looks like it checks for the OS error 120 first, then the MySQL
error code 120, producing:
"Error code 120: Unknown error: 120
120 = Didn't find key on read or update"
> I realize it is simpler if I know how may there are:
>
$ jot 4096 | xargs -n 16 perror | grep -v "Unknown error: " | tail
136 = No more room in index file
137 = No more records (read after end of file)
138 = Unsupported extension used for table
139 = Too big row (>= 16 M)
140 = Wrong create options
141 = Duplicate unique key or constraint on write or update
142 = Unknown character set used
143 = Conflicting table definition between MERGE and mapped table
144 = Table is crashed and last repair failed
145 = Table was marked as crashed and should be repaired
$ jot 4096 | xargs -n 16 perror | grep -v "Unknown error: " | wc -l
107
$ uname -sr
FreeBSD 4.3-STABLE
Regards,
--
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php