Bug #10367 Mac OS X 10.4 incorrectly sets SOCKET_SIZE_TYPE
Submitted: 4 May 2005 19:15 Modified: 7 Jul 2005 23:37
Reporter: Timothy Steiner Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:4.1.11 OS:MacOS (Mac OS X 10.4)
Assigned to: CPU Architecture:Any

[4 May 2005 19:15] Timothy Steiner
Description:
When compiling the source for MySQL 4.1.11 on Mac OS X 10.4, SOCKET_SIZE_TYPE is incorrectly set to int when it should be socklen_t.  This causes the following compile error:

mysqld.cc: In function `void* handle_connections_sockets(void*)':
mysqld.cc:3589: error: invalid conversion from 'size_socket*' to 'socklen_t*'
mysqld.cc:3589: error:   initializing argument 3 of 'int accept(int, sockaddr*, socklen_t*)'
mysqld.cc:3662: error: invalid conversion from 'size_socket*' to 'socklen_t*'
mysqld.cc:3662: error:   initializing argument 3 of 'int getsockname(int, sockaddr*, socklen_t*)'
sql_list.h: At global scope:
sql_list.h:401: warning: inline function `base_ilist::~base_ilist()' used but never defined
make[4]: *** [mysqld.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

How to repeat:
On Mac OS X 10.4 with Xcode 2.0 installed,
unpack mysql 4.1.11 source
$ ./configure
$ make

Suggested fix:
By manually changing config.h as follows (after running ./configure), compiling will complete successfully.

Change line #951 of config.h
from:
/* The base type of the last arg to accept */
#define SET_SIZE_TYPE int

to:
/* The base type of the last arg to accept */
#define SET_SIZE_TYPE socklen_t

I do not have enough experience to submit a better fix.
[7 Jul 2005 23:37] Kolbe Kegel
Thank you for your bug report. This issue has already been fixed
in the latest released version of that product, which you can download at 
http://www.mysql.com/downloads/

Additional info:

This problem has been fixed in release 4.1.12.