Bug #6057 Data Type Problem in manager.c
Submitted: 13 Oct 2004 3:08 Modified: 18 Oct 2004 9:12
Reporter: James Barwick Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:4.1.5-gamma OS:Linux (Linux amd64 (SUSE9.1))
Assigned to: Ramil Kalimullin CPU Architecture:Any

[13 Oct 2004 3:08] James Barwick
Description:
Line 271 of libmysql/manager.c has the definition

uint num_bytes;

The compare statement:

  if ((num_bytes=my_net_read(&con->net)) == packet_error)
  {
    con->last_errno=errno;
    strmov(con->last_error,"socket read failed");
    return 1;
  }

is never executed becuase packet_error is ulong and the compiler complains that this will always return false.

I have changed num_bytes to ulong.  This eliminated the warning.

Advise please on any problems that may result due to this change.

How to repeat:
compile manager.c on Linux a64 system

Suggested fix:
change

uint num_bytes;

to

ulong num_bytes;

on line 271 of manager.c
[18 Oct 2004 7:29] Ramil Kalimullin
Hello!

Thank you for the luminous bug report!

Ramil.
[18 Oct 2004 9:12] Ramil Kalimullin
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html