Commit 93948645 authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi

Fixes for --enable-named-pipe

parent 9a33ac70
...@@ -6349,6 +6349,9 @@ Optimized binary with support for symbolic links, BDB and InnoDB tables. ...@@ -6349,6 +6349,9 @@ Optimized binary with support for symbolic links, BDB and InnoDB tables.
Like @code{mysqld-max}, but compiled with support for named pipes. Like @code{mysqld-max}, but compiled with support for named pipes.
@end multitable @end multitable
Starting from 3.23.50, named pipes are only enabled if start mysqld with
@code{--enable-named-pipe}.
All of the above binaries are optimized for the Pentium Pro processor but All of the above binaries are optimized for the Pentium Pro processor but
should work on any Intel processor >= i386. should work on any Intel processor >= i386.
...@@ -10334,6 +10337,11 @@ You can force a MySQL client to use named pipes by specifying the ...@@ -10334,6 +10337,11 @@ You can force a MySQL client to use named pipes by specifying the
@code{--pipe} option or by specifying @code{.} as the host name. Use the @code{--pipe} option or by specifying @code{.} as the host name. Use the
@code{--socket} option to specify the name of the pipe. @code{--socket} option to specify the name of the pipe.
Note that starting from 3.23.50, named pipes are only enabled if start
mysqld with @code{--enable-named-pipe}. This is because some users have
experienced problems shutting down the MySQL server when one uses named
pipes.
You can test whether or not MySQL is working by executing the You can test whether or not MySQL is working by executing the
following commands: following commands:
...@@ -10613,6 +10621,9 @@ option to the new MySQL clients or create an option file ...@@ -10613,6 +10621,9 @@ option to the new MySQL clients or create an option file
host = localhost host = localhost
@end example @end example
Starting from 3.23.50, named pipes are only enabled if start mysqld with
@code{--enable-named-pipe}.
@item @code{Access denied for user} error @item @code{Access denied for user} error
If you get the error @code{Access denied for user: 'some-user@@unknown' If you get the error @code{Access denied for user: 'some-user@@unknown'
to database 'mysql'} when accessing a MySQL server on the same to database 'mysql'} when accessing a MySQL server on the same
...@@ -14724,6 +14735,10 @@ Enable system locking. Note that if you use this option on a system ...@@ -14724,6 +14735,10 @@ Enable system locking. Note that if you use this option on a system
which a not fully working lockd() (as on Linux) you will easily get which a not fully working lockd() (as on Linux) you will easily get
mysqld to deadlock. mysqld to deadlock.
@item --enable-named-pipe
Enable support for named pipes; This only works on NT and newer windows
versions.
@item -T, --exit-info @item -T, --exit-info
This is a bit mask of different flags one can use for debugging the This is a bit mask of different flags one can use for debugging the
mysqld server; One should not use this option if one doesn't know mysqld server; One should not use this option if one doesn't know
...@@ -43394,12 +43409,13 @@ are used if you don't specify a hostname or if you specify the special ...@@ -43394,12 +43409,13 @@ are used if you don't specify a hostname or if you specify the special
hostname @code{localhost}. hostname @code{localhost}.
On Windows you can connect only with TCP/IP if the @code{mysqld} server On Windows you can connect only with TCP/IP if the @code{mysqld} server
is running on Win95/Win98. If it's running on NT, you can also connect is running on Win95/Win98. If mysqld is running on NT and started with
with named pipes. The name of the named pipe is MySQL. If you @code{enable-named-pipe}, you can also connect with named pipes. The
don't give a hostname when connecting to @code{mysqld}, a MySQL client name of the named pipe is MySQL. If you don't give a hostname when
will first try to connect to the named pipe, and if this doesn't work it connecting to @code{mysqld}, a MySQL client will first try to connect to
will connect to the TCP/IP port. You can force the use of named pipes the named pipe, and if this doesn't work it will connect to the TCP/IP
on Windows by using @code{.} as the hostname. port. You can force the use of named pipes on Windows by using @code{.}
as the hostname.
The error (2002) @code{Can't connect to ...} normally means that there The error (2002) @code{Can't connect to ...} normally means that there
isn't a MySQL server running on the system or that you are isn't a MySQL server running on the system or that you are
...@@ -46897,6 +46913,10 @@ not yet 100% confident in this code. ...@@ -46897,6 +46913,10 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.50 @appendixsubsec Changes in release 3.23.50
@itemize @bullet @itemize @bullet
@item @item
Because of problems on shutdown we have now disabled named pipes on
windows by default. One can enable this with by starting mysqld with
@code{--enable-named-pipe}.
@item
Fixed bug when using @code{WHERE key_column = 'J' or key_column='j'}. Fixed bug when using @code{WHERE key_column = 'J' or key_column='j'}.
@item @item
Fixed core-dump bug when using @code{--log-bin} with @code{LOAD DATA Fixed core-dump bug when using @code{--log-bin} with @code{LOAD DATA
...@@ -155,6 +155,7 @@ static SECURITY_DESCRIPTOR sdPipeDescriptor; ...@@ -155,6 +155,7 @@ static SECURITY_DESCRIPTOR sdPipeDescriptor;
static HANDLE hPipe = INVALID_HANDLE_VALUE; static HANDLE hPipe = INVALID_HANDLE_VALUE;
static pthread_cond_t COND_handler_count; static pthread_cond_t COND_handler_count;
static uint handler_count; static uint handler_count;
static bool opt_enable_named_pipe = 0;
#endif #endif
#ifdef __WIN__ #ifdef __WIN__
static bool opt_console=0,start_mode=0; static bool opt_console=0,start_mode=0;
...@@ -220,9 +221,6 @@ static bool opt_log,opt_update_log,opt_bin_log,opt_slow_log,opt_noacl, ...@@ -220,9 +221,6 @@ static bool opt_log,opt_update_log,opt_bin_log,opt_slow_log,opt_noacl,
opt_disable_networking=0, opt_bootstrap=0,opt_skip_show_db=0, opt_disable_networking=0, opt_bootstrap=0,opt_skip_show_db=0,
opt_myisam_log=0, opt_myisam_log=0,
opt_large_files=sizeof(my_off_t) > 4; opt_large_files=sizeof(my_off_t) > 4;
#ifdef __NT__
static bool opt_enable_named_pipe = 0;
#endif
bool opt_sql_bin_update = 0, opt_log_slave_updates = 0, opt_safe_show_db=0, bool opt_sql_bin_update = 0, opt_log_slave_updates = 0, opt_safe_show_db=0,
opt_safe_user_create=0; opt_safe_user_create=0;
FILE *bootstrap_file=0; FILE *bootstrap_file=0;
...@@ -472,7 +470,7 @@ static void close_connections(void) ...@@ -472,7 +470,7 @@ static void close_connections(void)
} }
} }
#ifdef __NT__ #ifdef __NT__
if ( hPipe != INVALID_HANDLE_VALUE && opt_enable_named_pipe ) if (hPipe != INVALID_HANDLE_VALUE && opt_enable_named_pipe)
{ {
HANDLE temp; HANDLE temp;
DBUG_PRINT( "quit", ("Closing named pipes") ); DBUG_PRINT( "quit", ("Closing named pipes") );
...@@ -926,8 +924,8 @@ static void server_init(void) ...@@ -926,8 +924,8 @@ static void server_init(void)
#ifdef __NT__ #ifdef __NT__
/* create named pipe */ /* create named pipe */
if (Service.IsNT() && mysql_unix_port[0] && !opt_bootstrap if (Service.IsNT() && mysql_unix_port[0] && !opt_bootstrap &&
&& opt_enable_named_pipe) opt_enable_named_pipe)
{ {
sprintf( szPipeName, "\\\\.\\pipe\\%s", mysql_unix_port ); sprintf( szPipeName, "\\\\.\\pipe\\%s", mysql_unix_port );
ZeroMemory( &saPipeSecurity, sizeof(saPipeSecurity) ); ZeroMemory( &saPipeSecurity, sizeof(saPipeSecurity) );
...@@ -2004,10 +2002,10 @@ The server will not act as a slave."); ...@@ -2004,10 +2002,10 @@ The server will not act as a slave.");
fflush(stdout); fflush(stdout);
#ifdef __NT__ #ifdef __NT__
if ((hPipe == INVALID_HANDLE_VALUE && !have_tcpip ) || if (hPipe == INVALID_HANDLE_VALUE &&
(hPipe == INVALID_HANDLE_VALUE && opt_disable_networking) ) (!have_tcpip || opt_disable_networking)
{ {
sql_print_error("TCP/IP or enable-named-pipe should be configured on NT OS"); sql_print_error("TCP/IP or --enable-named-pipe should be configured on NT OS");
unireg_abort(1); unireg_abort(1);
} }
else else
...@@ -2017,7 +2015,7 @@ The server will not act as a slave."); ...@@ -2017,7 +2015,7 @@ The server will not act as a slave.");
{ {
pthread_t hThread; pthread_t hThread;
handler_count=0; handler_count=0;
if ( hPipe != INVALID_HANDLE_VALUE && opt_enable_named_pipe ) if (hPipe != INVALID_HANDLE_VALUE && opt_enable_named_pipe)
{ {
handler_count++; handler_count++;
if (pthread_create(&hThread,&connection_attrib, if (pthread_create(&hThread,&connection_attrib,
...@@ -2510,9 +2508,9 @@ pthread_handler_decl(handle_connections_namedpipes,arg) ...@@ -2510,9 +2508,9 @@ pthread_handler_decl(handle_connections_namedpipes,arg)
fConnected = ConnectNamedPipe( hPipe, NULL ); fConnected = ConnectNamedPipe( hPipe, NULL );
if (abort_loop) if (abort_loop)
break; break;
if ( !fConnected ) if (!fConnected)
fConnected = GetLastError() == ERROR_PIPE_CONNECTED; fConnected = GetLastError() == ERROR_PIPE_CONNECTED;
if ( !fConnected ) if (!fConnected)
{ {
CloseHandle( hPipe ); CloseHandle( hPipe );
if ((hPipe = CreateNamedPipe(szPipeName, if ((hPipe = CreateNamedPipe(szPipeName,
...@@ -2550,7 +2548,7 @@ pthread_handler_decl(handle_connections_namedpipes,arg) ...@@ -2550,7 +2548,7 @@ pthread_handler_decl(handle_connections_namedpipes,arg)
continue; // We have to try again continue; // We have to try again
} }
if ( !(thd = new THD)) if (!(thd = new THD))
{ {
DisconnectNamedPipe( hConnectedPipe ); DisconnectNamedPipe( hConnectedPipe );
CloseHandle( hConnectedPipe ); CloseHandle( hConnectedPipe );
...@@ -2634,9 +2632,7 @@ enum options { ...@@ -2634,9 +2632,7 @@ enum options {
OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS, OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS,
OPT_MAX_BINLOG_DUMP_EVENTS, OPT_SPORADIC_BINLOG_DUMP_FAIL, OPT_MAX_BINLOG_DUMP_EVENTS, OPT_SPORADIC_BINLOG_DUMP_FAIL,
OPT_SAFE_USER_CREATE, OPT_SQL_MODE, OPT_SAFE_USER_CREATE, OPT_SQL_MODE,
#ifdef __NT__
OPT_HAVE_NAMED_PIPE, OPT_HAVE_NAMED_PIPE,
#endif
OPT_SLAVE_SKIP_ERRORS, OPT_LOCAL_INFILE OPT_SLAVE_SKIP_ERRORS, OPT_LOCAL_INFILE
}; };
...@@ -2670,6 +2666,7 @@ static struct option long_options[] = { ...@@ -2670,6 +2666,7 @@ static struct option long_options[] = {
{"delay-key-write-for-all-tables", {"delay-key-write-for-all-tables",
no_argument, 0, (int) OPT_DELAY_KEY_WRITE}, no_argument, 0, (int) OPT_DELAY_KEY_WRITE},
{"enable-locking", no_argument, 0, (int) OPT_ENABLE_LOCK}, {"enable-locking", no_argument, 0, (int) OPT_ENABLE_LOCK},
{"enable-named-pipe", no_argument, 0, (int) OPT_HAVE_NAMED_PIPE},
{"exit-info", optional_argument, 0, 'T'}, {"exit-info", optional_argument, 0, 'T'},
{"flush", no_argument, 0, (int) OPT_FLUSH}, {"flush", no_argument, 0, (int) OPT_FLUSH},
#ifdef HAVE_GEMINI_DB #ifdef HAVE_GEMINI_DB
...@@ -2766,9 +2763,6 @@ static struct option long_options[] = { ...@@ -2766,9 +2763,6 @@ static struct option long_options[] = {
{"skip-host-cache", no_argument, 0, (int) OPT_SKIP_HOST_CACHE}, {"skip-host-cache", no_argument, 0, (int) OPT_SKIP_HOST_CACHE},
{"skip-name-resolve", no_argument, 0, (int) OPT_SKIP_RESOLVE}, {"skip-name-resolve", no_argument, 0, (int) OPT_SKIP_RESOLVE},
{"skip-networking", no_argument, 0, (int) OPT_SKIP_NETWORKING}, {"skip-networking", no_argument, 0, (int) OPT_SKIP_NETWORKING},
#ifdef __NT__
{"enable-named-pipe", no_argument, 0, (int) OPT_HAVE_NAMED_PIPE},
#endif
{"skip-new", no_argument, 0, (int) OPT_SKIP_NEW}, {"skip-new", no_argument, 0, (int) OPT_SKIP_NEW},
{"skip-safemalloc", no_argument, 0, (int) OPT_SKIP_SAFEMALLOC}, {"skip-safemalloc", no_argument, 0, (int) OPT_SKIP_SAFEMALLOC},
{"skip-show-database", no_argument, 0, (int) OPT_SKIP_SHOW_DB}, {"skip-show-database", no_argument, 0, (int) OPT_SKIP_SHOW_DB},
...@@ -3043,6 +3037,9 @@ struct show_var_st init_vars[]= { ...@@ -3043,6 +3037,9 @@ struct show_var_st init_vars[]= {
{"myisam_max_sort_file_size",(char*) &myisam_max_sort_file_size, SHOW_LONG}, {"myisam_max_sort_file_size",(char*) &myisam_max_sort_file_size, SHOW_LONG},
{"myisam_recover_options", (char*) &myisam_recover_options, SHOW_LONG}, {"myisam_recover_options", (char*) &myisam_recover_options, SHOW_LONG},
{"myisam_sort_buffer_size", (char*) &myisam_sort_buffer_size, SHOW_LONG}, {"myisam_sort_buffer_size", (char*) &myisam_sort_buffer_size, SHOW_LONG},
#ifdef __NT__
{"named_pipe", (char*) &opt_enable_named_pipe, SHOW_BOOL},
#endif
{"net_buffer_length", (char*) &net_buffer_length, SHOW_LONG}, {"net_buffer_length", (char*) &net_buffer_length, SHOW_LONG},
{"net_read_timeout", (char*) &net_read_timeout, SHOW_LONG}, {"net_read_timeout", (char*) &net_read_timeout, SHOW_LONG},
{"net_retry_count", (char*) &mysqld_net_retry_count, SHOW_LONG}, {"net_retry_count", (char*) &mysqld_net_retry_count, SHOW_LONG},
...@@ -3059,9 +3056,6 @@ struct show_var_st init_vars[]= { ...@@ -3059,9 +3056,6 @@ struct show_var_st init_vars[]= {
{"slave_net_timeout", (char*) &slave_net_timeout, SHOW_LONG}, {"slave_net_timeout", (char*) &slave_net_timeout, SHOW_LONG},
{"skip_locking", (char*) &my_disable_locking, SHOW_MY_BOOL}, {"skip_locking", (char*) &my_disable_locking, SHOW_MY_BOOL},
{"skip_networking", (char*) &opt_disable_networking, SHOW_BOOL}, {"skip_networking", (char*) &opt_disable_networking, SHOW_BOOL},
#ifdef __NT__
{"enable_named_pipe", (char*) &opt_enable_named_pipe, SHOW_BOOL},
#endif
{"skip_show_database", (char*) &opt_skip_show_db, SHOW_BOOL}, {"skip_show_database", (char*) &opt_skip_show_db, SHOW_BOOL},
{"slow_launch_time", (char*) &slow_launch_time, SHOW_LONG}, {"slow_launch_time", (char*) &slow_launch_time, SHOW_LONG},
{"socket", (char*) &mysql_unix_port, SHOW_CHAR_PTR}, {"socket", (char*) &mysql_unix_port, SHOW_CHAR_PTR},
...@@ -3437,7 +3431,7 @@ static void set_options(void) ...@@ -3437,7 +3431,7 @@ static void set_options(void)
} }
#else #else
const char *tmpenv; const char *tmpenv;
if ( !(tmpenv = getenv("MY_BASEDIR_VERSION"))) if (!(tmpenv = getenv("MY_BASEDIR_VERSION")))
tmpenv = DEFAULT_MYSQL_HOME; tmpenv = DEFAULT_MYSQL_HOME;
(void) strmov( mysql_home, tmpenv ); (void) strmov( mysql_home, tmpenv );
#endif #endif
...@@ -3770,11 +3764,6 @@ static void get_options(int argc,char **argv) ...@@ -3770,11 +3764,6 @@ static void get_options(int argc,char **argv)
opt_disable_networking=1; opt_disable_networking=1;
mysql_port=0; mysql_port=0;
break; break;
#ifdef __NT__
case (int) OPT_HAVE_NAMED_PIPE:
opt_enable_named_pipe=1;
break;
#endif
case (int) OPT_SKIP_SHOW_DB: case (int) OPT_SKIP_SHOW_DB:
opt_skip_show_db=1; opt_skip_show_db=1;
opt_specialflag|=SPECIAL_SKIP_SHOW_DB; opt_specialflag|=SPECIAL_SKIP_SHOW_DB;
...@@ -3829,6 +3818,11 @@ static void get_options(int argc,char **argv) ...@@ -3829,6 +3818,11 @@ static void get_options(int argc,char **argv)
case (int) OPT_INIT_FILE: case (int) OPT_INIT_FILE:
opt_init_file=optarg; opt_init_file=optarg;
break; break;
case (int) OPT_HAVE_NAMED_PIPE:
#if __NT__
opt_enable_named_pipe=1;
#endif
break;
#ifdef __WIN__ #ifdef __WIN__
case (int) OPT_STANDALONE: /* Dummy option for NT */ case (int) OPT_STANDALONE: /* Dummy option for NT */
break; break;
......
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