mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
New my_gethostbyname_r() handling
Changed some status variable names Fix bug in GRANT ... PASSWORD string Docs/manual.texi: Update of variable names include/my_net.h: New my_gethostbyname_r() handling include/my_pthread.h: New my_gethostbyname_r() handling libmysql/Makefile.shared: New my_gethostbyname_r() handling libmysql/libmysql.c: New my_gethostbyname_r() handling mysys/Makefile.am: New my_gethostbyname_r() handling mysys/my_pthread.c: New my_gethostbyname_r() handling mysys/my_thr_init.c: New my_gethostbyname_r() handling sql/hostname.cc: New my_gethostbyname_r() handling sql/mini_client.cc: New my_gethostbyname_r() handling sql/mysqld.cc: change some status variable names sql/sql_acl.cc: Fix bug in GRANT ... PASSWORD string
This commit is contained in:
parent
eba5ec8b4b
commit
d2b95cd7ab
13 changed files with 203 additions and 121 deletions
|
|
@ -56,7 +56,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
|
|||
thr_mutex.lo mulalloc.lo string.lo default.lo \
|
||||
my_compress.lo array.lo my_once.lo list.lo my_net.lo \
|
||||
charset.lo hash.lo mf_iocache.lo my_seek.lo \
|
||||
my_pread.lo mf_cache.lo
|
||||
my_pread.lo mf_cache.lo my_gethostbyname.lo
|
||||
# Not needed in the minimum library
|
||||
mysysobjects2 = getopt.lo getopt1.lo getvar.lo my_lib.lo
|
||||
mysysobjects = $(mysysobjects1) $(mysysobjects2)
|
||||
|
|
|
|||
|
|
@ -1312,7 +1312,6 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
|
|||
memcpy_fixed(&sock_addr.sin_addr,&ip_addr,sizeof(ip_addr));
|
||||
}
|
||||
else
|
||||
#if defined(HAVE_GETHOSTBYNAME_R) && defined(_REENTRANT) && defined(THREAD)
|
||||
{
|
||||
int tmp_errno;
|
||||
struct hostent tmp_hostent,*hp;
|
||||
|
|
@ -1323,22 +1322,12 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
|
|||
{
|
||||
net->last_errno=CR_UNKNOWN_HOST;
|
||||
sprintf(net->last_error, ER(CR_UNKNOWN_HOST), host, tmp_errno);
|
||||
my_gethostbyname_r_free();
|
||||
goto error;
|
||||
}
|
||||
memcpy(&sock_addr.sin_addr,hp->h_addr, (size_t) hp->h_length);
|
||||
my_gethostbyname_r_free();
|
||||
}
|
||||
#else
|
||||
{
|
||||
struct hostent *hp;
|
||||
if (!(hp=gethostbyname(host)))
|
||||
{
|
||||
net->last_errno=CR_UNKNOWN_HOST;
|
||||
sprintf(net->last_error, ER(CR_UNKNOWN_HOST), host, socket_errno);
|
||||
goto error;
|
||||
}
|
||||
memcpy(&sock_addr.sin_addr,hp->h_addr, (size_t) hp->h_length);
|
||||
}
|
||||
#endif
|
||||
sock_addr.sin_port = (ushort) htons((ushort) port);
|
||||
if (connect2(sock,(struct sockaddr *) &sock_addr, sizeof(sock_addr),
|
||||
mysql->options.connect_timeout) <0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue