From: Dmitry Shulga Date: January 19 2011 7:16am Subject: Re: bzr commit into mysql-5.1-bugteam branch (Dmitry.Shulga:3521) Bug#57450 List-Archive: http://lists.mysql.com/commits/129138 Message-Id: <0B9FC189-4F40-43FF-83FA-9A3DAC1A126E@oracle.com> MIME-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Hi Davi! On 17.01.2011, at 15:18, Davi Arnaut wrote: > Hi Dmitry, >=20 > On 1/12/11 2:13 PM, Dmitry Shulga wrote: >> #At file:///Users/shulga/projects/mysql/5.1-bugteam-bug57450/ based = on revid:azundris@stripped >>=20 >> 3521 Dmitry Shulga 2011-01-12 >> Fixed bug#57450 - mysql client enter in an infinite loop >> if the standard input is a directory. >>=20 >> The problem is that mysql monitor try to read from stdin = without >> checking input source type. >>=20 >> The solution is to stop reading data from standard input if a = call >> to read(2) failed. >>=20 >> A new output parameter was introduced into functions = batch_readline() >> and intern_read_line() in order to differentiate between >> cases of getting EOF and getting error on standard input. >>=20 >=20 > The error handling looks good so far, but I particularly don't like = how the error and EOF states are being passed. I prefer the state (EOF = and error) to be associated with the buffer. The attached patch = implements this approach. Your approach is good. I will implement and fix it. >=20 > Regards, >=20 > Davi >=20 > <57450-review.patch>