Bug #34150 read looped with error 4, aborting thread
Submitted: 29 Jan 2008 21:53 Modified: 19 Feb 2011 10:24
Reporter: Peter Gulutzan Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.5.9-debug, 6.0.5-alpha-debug OS:Linux
Assigned to: Davi Arnaut CPU Architecture:Any

[29 Jan 2008 21:53] Peter Gulutzan
Description:
While a lengthy stored procedure is executing
using the mysql client, I use the mouse to
change the width or length of the window.

I see the error message
/usr/local/mysql/bin/mysql: read looped with error 4, aborting thread

This has no effect on the server, the stored
procedure continues to run correctly.

How to repeat:
I use SUSE 10.0, KDE.
The mysql client program is running
with the Konsole Terminal Program
(an ordinary shell).

Create and run a stored procedure thus:

delimiter //
drop table t//
drop procedure p//
CREATE TABLE t (int_column INT, char_column CHAR(5)) ENGINE=FALCON
PARTITION BY LIST (int_column % 5)
SUBPARTITION BY KEY(char_column) SUBPARTITIONS 3
(PARTITION p0 VALUES IN (0),
 PARTITION p1 VALUES IN (1),
 PARTITION p2 VALUES IN (2),
 PARTITION p3 VALUES IN (3),
 PARTITION p4 VALUES IN (4))//
SET @@autocommit=0//
CREATE PROCEDURE p ()
BEGIN
  DECLARE v_rownum INT DEFAULT 0;
  DECLARE v_random_character CHAR(1);
  DECLARE v_random_string VARCHAR(5);
  WHILE v_rownum < 1000000 DO
    IF V_rownum MOD 1000 = 0 THEN COMMIT; SELECT v_rownum; END IF;
    SET v_random_string = '';
    WHILE LENGTH(v_random_string) < 5 DO
      SET v_random_character = CHAR(RAND()*128);
      IF v_random_character BETWEEN 'a' AND 'z' THEN
        SET v_random_string = CONCAT(v_random_string,v_random_character);
        END IF;
      END WHILE;
    SET @stmt1 = CONCAT('INSERT INTO t VALUES (',
    v_rownum, ',''', v_random_string, ''');');
    PREPARE stmt1 FROM @stmt1;
    EXECUTE stmt1;
    SET v_rownum = v_rownum + 1;
    END WHILE;
  END//
CALL p()//

...

While the stored procedure is running,
take the mouse and attach it to the
right or bottom of the window, holding
it down, in the usual way that one alters
the width or length of a window.
Move the mouse back and forth to change
the width or length.
Notice that the "read looped ..." error
message appears as window size changes.
[30 Jan 2008 9:43] MySQL Verification Team
Thank you for the bug report. Verified as described.

 bin/mysql: read looped with error 4, aborting thread
bin/mysql: read looped with error 4, aborting thread
+----------+
| v_rownum |
+----------+
|    15000 |
+----------+
1 row in set (43.15 sec)

bin/mysql: read looped with error 4, aborting thread
[15 May 2009 22:28] Jim Winstead
this only happens when the client is compiled with extra debugging that is only ever enabled using the BUILD/* scripts, and it's not worth complicating the already-tortured my_real_read() any further to suppress this spurious warning.
[22 Oct 2010 17:12] MySQL Verification Team
just noting that i got this from the server today...

/home/sbester/mysql/5.5/mysql-5.5.8-ga-linux-x86_64/bin/mysqld: read looped with error 4, aborting thread
[New Thread 0x7fffc85d2710 (LWP 11923)]
[Thread 0x7fffc8613710 (LWP 11922) exited]
[Thread 0x7ffff4093710 (LWP 11763) exited]
[Thread 0x7ffff4052710 (LWP 21778) exited]
[New Thread 0x7ffff4052710 (LWP 11939)]
/home/sbester/mysql/5.5/mysql-5.5.8-ga-linux-x86_64/bin/mysqld: read looped with error 4, aborting thread
[Thread 0x7ffff4052710 (LWP 11939) exited]
[Thread 0x7fffc8550710 (LWP 11917) exited]
[New Thread 0x7ffff4052710 (LWP 11940)]
[New Thread 0x7fffc8550710 (LWP 12001)]
/home/sbester/mysql/5.5/mysql-5.5.8-ga-linux-x86_64/bin/mysqld: read looped with error 4, aborting thread
[Thread 0x7fffc8591710 (LWP 11920) exited]
[11 Jan 2011 1:34] Roel Van de Paar
Can we have another look at what is happening here exactly? See mysqld errors above. I get these errors simply running threads which are creating/dropping/altering tables. Easy to reproduce.
[19 Feb 2011 10:24] Davi Arnaut
Jim's comments still applies. This is just a misplaced debug printout that will soon be gone.