Bug #22106 can't output to error log file when INNODB happened ERROR1205
Submitted: 8 Sep 2006 6:46 Modified: 5 Dec 2007 18:55
Reporter: Kanako Nakai Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.0.26-BK OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[8 Sep 2006 6:46] Kanako Nakai
Description:
----------
create table test (id int ,name text)engine=innodb;
insert into test values ( 1, 'test'); 

----------
Pattern 1
----------

CLIENT A:
begin; 
select * from test lock in share mode;

----------
CLIENT B:
begin;
update test set name='bbb' where id=1;

After 50sec,The following messages are output to the client.

ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

----------
MYSQL didn't add error message to error.log.

----------
Pattern 2
----------

CLIENT A:
begin; 
update test set name='oooo' where id=1;

----------
CLIENT B:
select * from test order by id, name for update; 

After 50sec,The following messages are output to the client.

ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

----------
MYSQL did add error message to error.log.

060808 15:46:09 [ERROR] C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: Lock wait timeout exceeded; try restarting transaction 
060808 15:46:09 [ERROR] C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: Sort aborted

How to repeat:
----------
create table test (id int ,name text)engine=innodb;
insert into test values ( 1, 'test'); 

----------
Pattern 1
----------

CLIENT A:
begin; 
select * from test lock in share mode;

----------
CLIENT B:
begin;
update test set name='bbb' where id=1;

After 50sec,The following messages are output to the client.

ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

----------
MYSQL didn't add error message to error.log.

----------
Pattern 2
----------

CLIENT A:
begin; 
update test set name='oooo' where id=1;

----------
CLIENT B:
select * from test order by id, name for update; 

After 50sec,The following messages are output to the client.

ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

----------
MYSQL did add error message to error.log.

060808 15:46:09 [ERROR] C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: Lock wait timeout exceeded; try restarting transaction 
060808 15:46:09 [ERROR] C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: Sort aborted
[8 Sep 2006 6:47] Kanako Nakai
修正
[8 Sep 2006 14:15] Valeriy Kravchuk
Thank you for a bug report. Verified just as described with 5.0.26-BK on Linux. I think, it is a bug, because of inconsistent behaviour.
[11 Sep 2006 11:57] Heikki Tuuri
This is an old bug in the MySQL Server. The code in /sql/sql_select.cc or some other file should be modified so that it is prepared that also a SELECT can return a lock wait timeout error or a transactional deadlock error! It is a perfectly normal situation, no printout to the .err log should happen.