Commit b09c0acd authored by Michael Widenius's avatar Michael Widenius

Fixed wrong test for extra_ip_sock that caused mysqld to die on Mac if --extra-port was used

sql/sql_string.cc:
  Optimized tests to do fewer reallocs
sql/strfunc.cc:
  Indentation fix
parent 8b0c4b77
...@@ -4974,11 +4974,11 @@ inline void kill_broken_server() ...@@ -4974,11 +4974,11 @@ inline void kill_broken_server()
#if !defined(__NETWARE__) #if !defined(__NETWARE__)
unix_sock == INVALID_SOCKET || unix_sock == INVALID_SOCKET ||
#endif #endif
(!opt_disable_networking && (!opt_disable_networking && ip_sock == INVALID_SOCKET))
(base_ip_sock == INVALID_SOCKET || extra_ip_sock != INVALID_SOCKET)))
{ {
select_thread_in_use = 0; select_thread_in_use = 0;
/* The following call will never return */ /* The following call will never return */
DBUG_PRINT("general", ("killing server because socket is closed"));
kill_server(IF_NETWARE(MYSQL_KILL_SIGNAL, (void*) MYSQL_KILL_SIGNAL)); kill_server(IF_NETWARE(MYSQL_KILL_SIGNAL, (void*) MYSQL_KILL_SIGNAL));
} }
} }
......
...@@ -65,10 +65,10 @@ bool String::real_alloc(uint32 arg_length) ...@@ -65,10 +65,10 @@ bool String::real_alloc(uint32 arg_length)
bool String::realloc(uint32 alloc_length) bool String::realloc(uint32 alloc_length)
{ {
uint32 len=ALIGN_SIZE(alloc_length+1); if (Alloced_length <= alloc_length)
if (Alloced_length < len)
{ {
char *new_ptr; char *new_ptr;
uint32 len= ALIGN_SIZE(alloc_length+1);
if (alloced) if (alloced)
{ {
if ((new_ptr= (char*) my_realloc(Ptr,len,MYF(MY_WME)))) if ((new_ptr= (char*) my_realloc(Ptr,len,MYF(MY_WME))))
......
...@@ -38,7 +38,8 @@ ...@@ -38,7 +38,8 @@
static const char field_separator=','; static const char field_separator=',';
ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, ulonglong find_set(TYPELIB *lib, const char *str, uint length,
CHARSET_INFO *cs,
char **err_pos, uint *err_len, bool *set_warning) char **err_pos, uint *err_len, bool *set_warning)
{ {
CHARSET_INFO *strip= cs ? cs : &my_charset_latin1; CHARSET_INFO *strip= cs ? cs : &my_charset_latin1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment