Commit e1099fac authored by unknown's avatar unknown
Browse files

Merge with 4.0


vio/viosocket.c:
  Auto merged
mysql-test/t/group_by.test:
  Use local file
sql/sql_parse.cc:
  Merge with 4.0 to get bug fix for reconnect problem
parents 1d633f64 358cfd6c
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -656,12 +656,12 @@ static int check_connection(THD *thd)
{
  uint connect_errors= 0;
  NET *net= &thd->net;
  ulong pkt_len= 0;
  char *end;

  DBUG_PRINT("info",
             ("New connection received on %s", vio_description(net->vio)));

  vio_in_addr(net->vio,&thd->remote.sin_addr);

  if (!thd->host)                           // If TCP/IP connection
  {
    char ip[30];
@@ -671,6 +671,7 @@ static int check_connection(THD *thd)
    if (!(thd->ip= my_strdup(ip,MYF(0))))
      return (ER_OUT_OF_RESOURCES);
    thd->host_or_ip= thd->ip;
    vio_in_addr(net->vio,&thd->remote.sin_addr);
#if !defined(HAVE_SYS_UN_H) || defined(HAVE_mit_thread)
    /* Fast local hostname resolve for Win32 */
    if (!strcmp(thd->ip,"127.0.0.1"))
@@ -706,10 +707,10 @@ static int check_connection(THD *thd)
    DBUG_PRINT("info",("Host: %s",thd->host));
    thd->host_or_ip= thd->host;
    thd->ip= 0;
    /* Reset sin_addr */
    bzero((char*) &thd->remote, sizeof(thd->remote));
  }
  vio_keepalive(net->vio, TRUE);
  ulong pkt_len= 0;
  char *end;
  {
    /* buff[] needs to big enough to hold the server_version variable */
    char buff[SERVER_VERSION_LENGTH + SCRAMBLE_LENGTH + 64];
+12 −0
Original line number Diff line number Diff line
@@ -272,6 +272,18 @@ my_bool vio_peer_addr(Vio * vio, char *buf, uint16 *port)
}


/*
  Get in_addr for a TCP/IP connection

  SYNOPSIS
    vio_in_addr()
    vio		vio handle
    in		put in_addr here

  NOTES
    one must call vio_peer_addr() before calling this one
*/

void vio_in_addr(Vio *vio, struct in_addr *in)
{
  DBUG_ENTER("vio_in_addr");