Bug #1795 read_key: Got error 149 when reading table
Submitted: 10 Nov 2003 11:38 Modified: 4 Dec 2003 7:06
Reporter: marc slemko Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.15a OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[10 Nov 2003 11:38] marc slemko
Description:
in my mysql.err log:

031106  5:02:04  read_key: Got error 149 when reading table './database/tablename'

How to repeat:
unsure

Suggested fix:
It appears that this is due to a deadlock, which is not really an error so the only bug is that it is being logged.

in sql/sql_select.cc, join_read_key does not check for HA_ERR_LOCK_DEADLOCK like many of the other similar functions.  

Assuming there is no hidden problem here, just adding the appropriate check to not print the error should fix it.
[4 Dec 2003 6:23] Alexander Keremidarski
# perror 149
149 = Lock deadlock; Retry transaction

If I understand you well you say that error 149 falls into Warning category and being such it should not be logged into MySQL error log.

Here are two reasons why such error must be logged:

1. It is arguable if failed transaction should be treated as Error or Warning. It depends on design point of view

2. MySQL error log is intended to log both Errors and Warnings that's even of perror 149 is considered Warining it should be logged there.

149 = Lock deadlock; Retry transaction
[4 Dec 2003 7:06] Heikki Tuuri
Hi!

I agree that it is a bug if mysqld prints to the .err log about transaction deadlocks and lock wait timeouts.

But this bug has been fixed in 4.1.1: in sql_select.cc, a function report_error() is called, which does not print anything about these specific errors to the .err log.

I do not think it pays to backport the fix to 4.0, because this is not a critical bug.

Best regards,

Heikki