Commit bffc615e authored by kostja@bodhi.(none)'s avatar kostja@bodhi.(none)
Browse files

Merge bk-internal.mysql.com:/home/bk/mysql-5.1

into  bodhi.(none):/opt/local/work/mysql-5.1-runtime
parents 2db74257 0488056c
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -8018,7 +8018,6 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
    if (!len)
    {
      errno=EINVAL;
      my_message(0,"No to-string for last from-string",MYF(ME_BELL));
      DBUG_RETURN(0);
    }
    states+=len+1;
+9 −10
Original line number Diff line number Diff line
@@ -203,14 +203,10 @@ typedef struct st_net {
  unsigned int *return_status;
  unsigned char reading_or_writing;
  char save_char;
  my_bool no_send_ok;  /* For SPs and other things that do multiple stmts */
  my_bool unused0; /* Please remove with the next incompatible ABI change. */
  my_bool unused; /* Please remove with the next incompatible ABI change */
  my_bool compress;
  /*
    Set if OK packet is already sent, and we do not need to send error
    messages
  */
  my_bool no_send_error;
  my_bool unused1; /* Please remove with the next incompatible ABI change. */
  /*
    Pointer to query object in query cache, do not equal NULL (0) for
    queries in cache that have not stored its results yet
@@ -221,11 +217,14 @@ typedef struct st_net {
    functions and methods to maintain proper locking.
  */
  unsigned char *query_cache_query;
  unsigned int last_errno;
  unsigned int client_last_errno;
  unsigned char error; 
  my_bool report_error; /* We should report error (we have unreported error) */
  my_bool unused2; /* Please remove with the next incompatible ABI change. */
  my_bool return_errno;
  char last_error[MYSQL_ERRMSG_SIZE], sqlstate[SQLSTATE_LENGTH+1];
  /** Client library error message buffer. Actually belongs to struct MYSQL. */
  char client_last_error[MYSQL_ERRMSG_SIZE];
  /** Client library sqlstate buffer. Set along with the error message. */
  char sqlstate[SQLSTATE_LENGTH+1];
  void *extension;
} NET;

+5 −5
Original line number Diff line number Diff line
@@ -537,16 +537,16 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
    unsigned int * return_status;
    unsigned char reading_or_writing;
    char save_char;
    my_bool no_send_ok;
    my_bool unused0;
    my_bool unused;
    my_bool compress;
    my_bool no_send_error;
    my_bool unused1;
    unsigned char * query_cache_query;
    unsigned int last_errno;
    unsigned int client_last_errno;
    unsigned char error;
    my_bool report_error;
    my_bool unused2;
    my_bool return_errno;
    char last_error[512];
    char client_last_error[512];
    char sqlstate[(5 + 1)];
    void * extension;
  };
+22 −18
Original line number Diff line number Diff line
@@ -440,11 +440,11 @@ static void expand_error(MYSQL* mysql, int error)
  char tmp[MYSQL_ERRMSG_SIZE];
  char *p;
  uint err_length;
  strmake(tmp, mysql->net.last_error, MYSQL_ERRMSG_SIZE-1);
  p = strmake(mysql->net.last_error, ER(error), MYSQL_ERRMSG_SIZE-1);
  err_length= (uint) (p - mysql->net.last_error);
  strmake(tmp, mysql->net.client_last_error, MYSQL_ERRMSG_SIZE-1);
  p = strmake(mysql->net.client_last_error, ER(error), MYSQL_ERRMSG_SIZE-1);
  err_length= (uint) (p - mysql->net.client_last_error);
  strmake(p, tmp, MYSQL_ERRMSG_SIZE-1 - err_length);
  mysql->net.last_errno = error;
  mysql->net.client_last_errno = error;
}

/*
@@ -870,9 +870,10 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
    VOID(my_net_write(net,(const uchar*) "",0)); /* Server needs one packet */
    net_flush(net);
    strmov(net->sqlstate, unknown_sqlstate);
    net->last_errno= (*options->local_infile_error)(li_ptr,
						    net->last_error,
						    sizeof(net->last_error)-1);
    net->client_last_errno=
      (*options->local_infile_error)(li_ptr,
                                     net->client_last_error,
                                     sizeof(net->client_last_error)-1);
    goto err;
  }

@@ -899,9 +900,10 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)

  if (readcount < 0)
  {
    net->last_errno= (*options->local_infile_error)(li_ptr,
						    net->last_error,
						    sizeof(net->last_error)-1);
    net->client_last_errno=
      (*options->local_infile_error)(li_ptr,
                                     net->client_last_error,
                                     sizeof(net->client_last_error)-1);
    goto err;
  }

@@ -1395,7 +1397,7 @@ const char *cli_read_statistics(MYSQL *mysql)
  if (!mysql->net.read_pos[0])
  {
    set_mysql_error(mysql, CR_WRONG_HOST_INFO, unknown_sqlstate);
    return mysql->net.last_error;
    return mysql->net.client_last_error;
  }
  return (char*) mysql->net.read_pos;
}
@@ -1406,7 +1408,7 @@ mysql_stat(MYSQL *mysql)
{
  DBUG_ENTER("mysql_stat");
  if (simple_command(mysql,COM_STATISTICS,0,0,0))
    DBUG_RETURN(mysql->net.last_error);
    DBUG_RETURN(mysql->net.client_last_error);
  DBUG_RETURN((*mysql->methods->read_statistics)(mysql));
}

@@ -1771,7 +1773,7 @@ static my_bool my_realloc_str(NET *net, ulong length)
    if (res)
    {
      strmov(net->sqlstate, unknown_sqlstate);
      strmov(net->last_error, ER(net->last_errno));
      strmov(net->client_last_error, ER(net->client_last_errno));
    }
    net->write_pos= net->buff+ buf_length;
  }
@@ -1822,13 +1824,15 @@ void set_stmt_error(MYSQL_STMT * stmt, int errcode,
void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net)
{
  DBUG_ENTER("set_stmt_errmsg");
  DBUG_PRINT("enter", ("error: %d/%s '%s'", net->last_errno, net->sqlstate,
                       net->last_error));
  DBUG_PRINT("enter", ("error: %d/%s '%s'",
                       net->client_last_errno,
                       net->sqlstate,
                       net->client_last_error));
  DBUG_ASSERT(stmt != 0);

  stmt->last_errno= net->last_errno;
  if (net->last_error && net->last_error[0])
    strmov(stmt->last_error, net->last_error);
  stmt->last_errno= net->client_last_errno;
  if (net->client_last_error && net->client_last_error[0])
    strmov(stmt->last_error, net->client_last_error);
  strmov(stmt->sqlstate, net->sqlstate);

  DBUG_VOID_RETURN;
+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
  msg_len=strlen(msg_buf);
  if (my_net_write(&con->net,(uchar*) msg_buf,msg_len) || net_flush(&con->net))
  {
    con->last_errno=con->net.last_errno;
    con->last_errno=con->net.client_last_errno;
    strmov(con->last_error,"Write error on socket");
    goto err;
  }
Loading