List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:November 29 1999 11:56pm
Subject:[PATCH] Re: mysql-3.23.6-alpha on Linux Alpha
View as plain text  
>>>>> "Tom" == Tom Holroyd <tomh@stripped> writes:

Tom> On Fri, 19 Nov 1999, Tom Holroyd wrote:
>> runtime errors:
>> 
>> 2) load data local infile doesn't work.  It just hangs and eventually gets
>> ERROR 1159: Got timeout reading communication packets
>> (same for mysqlimport --local).  I don't know why.

Tom> This turns out to be a bug in libmysql.c:mysql_real_query() on the client
Tom> side.  The problem is that NULL_LENGTH is defined as (unsigned long)~0,
Tom> and field_count is declared as uint, so the test for LOCAL INFILE compares
Tom> a long (64 bits) -1 with an int (32 bits) -1, which fails, and mysql
Tom> thinks it's not local and waits for the server to send the file.

Tom> One way to fix it is to make field_count signed, so the comparison works:

Tom> --- libmysql.c.orig     Fri Nov 26 15:19:58 1999
Tom> +++ libmysql.c  Fri Nov 26 15:20:43 1999
Tom> @@ -1448,7 +1448,7 @@
Tom>  mysql_real_query(MYSQL *mysql, const char *query,uint length)
Tom>  {
Tom>    uchar *pos;
Tom> -  uint field_count;
Tom> +  int field_count;
Tom>    MYSQL_DATA *fields;
Tom>    DBUG_ENTER("mysql_real_query");
Tom>    DBUG_PRINT("enter",("handle: %lx",mysql));

Applied.

Thanks!

Regards,
Monty
Thread
mysql-3.23.6-alpha on Linux AlphaTom Holroyd19 Nov
  • Re: mysql-3.23.6-alpha on Linux AlphaTom Holroyd19 Nov
  • [PATCH] Re: mysql-3.23.6-alpha on Linux AlphaTom Holroyd26 Nov
    • [PATCH] Re: mysql-3.23.6-alpha on Linux AlphaMichael Widenius30 Nov
  • mysql-3.23.6-alpha on Linux AlphaMichael Widenius30 Nov
    • Re: mysql-3.23.6-alpha on Linux AlphaTom Holroyd30 Nov
      • Re: mysql-3.23.6-alpha on Linux AlphaMichael Widenius30 Nov