mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/my/mysql-4.0
This commit is contained in:
@ -316,7 +316,7 @@ inline double ulonglong2double(ulonglong value)
|
|||||||
#define FN_ROOTDIR "\\"
|
#define FN_ROOTDIR "\\"
|
||||||
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
|
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
|
||||||
#define FN_NO_CASE_SENCE /* Files are not case-sensitive */
|
#define FN_NO_CASE_SENCE /* Files are not case-sensitive */
|
||||||
#define MY_NFILE 1024
|
#define MY_NFILE 2048
|
||||||
|
|
||||||
#define DO_NOT_REMOVE_THREAD_WRAPPERS
|
#define DO_NOT_REMOVE_THREAD_WRAPPERS
|
||||||
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
|
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
|
||||||
|
@ -316,7 +316,7 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host,
|
|||||||
char **arg_unix_socket)
|
char **arg_unix_socket)
|
||||||
{
|
{
|
||||||
HANDLE hPipe=INVALID_HANDLE_VALUE;
|
HANDLE hPipe=INVALID_HANDLE_VALUE;
|
||||||
char szPipeName [ 1024 ];
|
char pipe_name[1024];
|
||||||
DWORD dwMode;
|
DWORD dwMode;
|
||||||
int i;
|
int i;
|
||||||
my_bool testing_named_pipes=0;
|
my_bool testing_named_pipes=0;
|
||||||
@ -327,13 +327,15 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host,
|
|||||||
if (!host || !strcmp(host,LOCAL_HOST))
|
if (!host || !strcmp(host,LOCAL_HOST))
|
||||||
host=LOCAL_HOST_NAMEDPIPE;
|
host=LOCAL_HOST_NAMEDPIPE;
|
||||||
|
|
||||||
strxnmov(szPipeName, sizeof(szPipeName), "\\\\", host, "\\pipe\\",
|
|
||||||
unix_socket, NullS);
|
pipe_name[sizeof(pipe_name)-1]= 0; /* Safety if too long string */
|
||||||
|
strxnmov(pipe_name, sizeof(pipe_name)-1, "\\\\", host, "\\pipe\\",
|
||||||
|
unix_socket, NullS);
|
||||||
DBUG_PRINT("info",("Server name: '%s'. Named Pipe: %s", host, unix_socket));
|
DBUG_PRINT("info",("Server name: '%s'. Named Pipe: %s", host, unix_socket));
|
||||||
|
|
||||||
for (i=0 ; i < 100 ; i++) /* Don't retry forever */
|
for (i=0 ; i < 100 ; i++) /* Don't retry forever */
|
||||||
{
|
{
|
||||||
if ((hPipe = CreateFile(szPipeName,
|
if ((hPipe = CreateFile(pipe_name,
|
||||||
GENERIC_READ | GENERIC_WRITE,
|
GENERIC_READ | GENERIC_WRITE,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
@ -349,7 +351,7 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host,
|
|||||||
return INVALID_HANDLE_VALUE;
|
return INVALID_HANDLE_VALUE;
|
||||||
}
|
}
|
||||||
/* wait for for an other instance */
|
/* wait for for an other instance */
|
||||||
if (! WaitNamedPipe(szPipeName, connect_timeout*1000) )
|
if (! WaitNamedPipe(pipe_name, connect_timeout*1000) )
|
||||||
{
|
{
|
||||||
net->last_errno=CR_NAMEDPIPEWAIT_ERROR;
|
net->last_errno=CR_NAMEDPIPEWAIT_ERROR;
|
||||||
sprintf(net->last_error,ER(net->last_errno),host, unix_socket,
|
sprintf(net->last_error,ER(net->last_errno),host, unix_socket,
|
||||||
|
@ -123,11 +123,12 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
|
|||||||
}
|
}
|
||||||
#ifdef OS2
|
#ifdef OS2
|
||||||
/* changing environ variable doesn't work with VACPP */
|
/* changing environ variable doesn't work with VACPP */
|
||||||
char buffer[256];
|
char buffer[256], *end;
|
||||||
strxnmov(buffer, sizeof(buffer), "TMP=", dir);
|
buffer[sizeof[buffer)-1]= 0;
|
||||||
|
end= strxnmov(buffer, sizeof(buffer)-1, (char*) "TMP=", dir, NullS);
|
||||||
/* remove ending backslash */
|
/* remove ending backslash */
|
||||||
if (buffer[strlen(buffer)-1] == '\\')
|
if (end[-1] == '\\')
|
||||||
buffer[strlen(buffer)-1] = '\0';
|
end[-1]= 0;
|
||||||
putenv(buffer);
|
putenv(buffer);
|
||||||
#elif !defined(__NETWARE__)
|
#elif !defined(__NETWARE__)
|
||||||
old_env= (char**) environ;
|
old_env= (char**) environ;
|
||||||
|
@ -105,12 +105,13 @@ my_string my_tempnam(const char *dir, const char *pfx,
|
|||||||
}
|
}
|
||||||
#ifdef OS2
|
#ifdef OS2
|
||||||
/* changing environ variable doesn't work with VACPP */
|
/* changing environ variable doesn't work with VACPP */
|
||||||
char buffer[256];
|
char buffer[256], *end;
|
||||||
strxnmov(buffer, sizeof(buffer), "TMP=", dir);
|
buffer[sizeof[buffer)-1]= 0;
|
||||||
|
end= strxnmov(buffer, sizeof(buffer)-1, (char*) "TMP=", dir, NullS);
|
||||||
/* remove ending backslash */
|
/* remove ending backslash */
|
||||||
if (buffer[strlen(buffer)-1] == '\\')
|
if (end[-1] == '\\')
|
||||||
buffer[strlen(buffer)-1] = '\0';
|
end[-1]= 0;
|
||||||
putenv( buffer);
|
putenv(buffer);
|
||||||
#elif !defined(__NETWARE__)
|
#elif !defined(__NETWARE__)
|
||||||
old_env=(char**)environ;
|
old_env=(char**)environ;
|
||||||
if (dir)
|
if (dir)
|
||||||
|
21
sql/log.cc
21
sql/log.cc
@ -231,18 +231,21 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
|
|||||||
}
|
}
|
||||||
case LOG_NEW:
|
case LOG_NEW:
|
||||||
{
|
{
|
||||||
|
uint len;
|
||||||
time_t skr=time(NULL);
|
time_t skr=time(NULL);
|
||||||
struct tm tm_tmp;
|
struct tm tm_tmp;
|
||||||
|
|
||||||
localtime_r(&skr,&tm_tmp);
|
localtime_r(&skr,&tm_tmp);
|
||||||
my_snprintf(buff,sizeof(buff),"# %s, Version: %s at %02d%02d%02d %2d:%02d:%02d\n",
|
len= my_snprintf(buff,sizeof(buff),
|
||||||
my_progname,server_version,
|
"# %s, Version: %s at %02d%02d%02d %2d:%02d:%02d\n",
|
||||||
tm_tmp.tm_year % 100,
|
my_progname,server_version,
|
||||||
tm_tmp.tm_mon+1,
|
tm_tmp.tm_year % 100,
|
||||||
tm_tmp.tm_mday,
|
tm_tmp.tm_mon+1,
|
||||||
tm_tmp.tm_hour,
|
tm_tmp.tm_mday,
|
||||||
tm_tmp.tm_min,
|
tm_tmp.tm_hour,
|
||||||
tm_tmp.tm_sec);
|
tm_tmp.tm_min,
|
||||||
if (my_b_write(&log_file, (byte*) buff,(uint) strlen(buff)) ||
|
tm_tmp.tm_sec);
|
||||||
|
if (my_b_write(&log_file, (byte*) buff, len) ||
|
||||||
flush_io_cache(&log_file))
|
flush_io_cache(&log_file))
|
||||||
goto err;
|
goto err;
|
||||||
break;
|
break;
|
||||||
|
@ -117,7 +117,7 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host,
|
|||||||
char **arg_unix_socket)
|
char **arg_unix_socket)
|
||||||
{
|
{
|
||||||
HANDLE hPipe=INVALID_HANDLE_VALUE;
|
HANDLE hPipe=INVALID_HANDLE_VALUE;
|
||||||
char szPipeName [512];
|
char pipe_name[512];
|
||||||
DWORD dwMode;
|
DWORD dwMode;
|
||||||
int i;
|
int i;
|
||||||
my_bool testing_named_pipes=0;
|
my_bool testing_named_pipes=0;
|
||||||
@ -126,14 +126,15 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host,
|
|||||||
if (!host || !strcmp(host,LOCAL_HOST))
|
if (!host || !strcmp(host,LOCAL_HOST))
|
||||||
host=LOCAL_HOST_NAMEDPIPE;
|
host=LOCAL_HOST_NAMEDPIPE;
|
||||||
|
|
||||||
strxnmov(szPipeName, sizeof(szPipeName), "\\\\", host, "\\pipe\\",
|
pipe_name[sizeof(pipe_name)-1]= 0; /* Safety if too long string */
|
||||||
unix_socket, NullS);
|
strxnmov(pipe_name, sizeof(pipe_name)-1, "\\\\", host, "\\pipe\\",
|
||||||
|
unix_socket, NullS);
|
||||||
DBUG_PRINT("info",("Server name: '%s'. Named Pipe: %s",
|
DBUG_PRINT("info",("Server name: '%s'. Named Pipe: %s",
|
||||||
host, unix_socket));
|
host, unix_socket));
|
||||||
|
|
||||||
for (i=0 ; i < 100 ; i++) /* Don't retry forever */
|
for (i=0 ; i < 100 ; i++) /* Don't retry forever */
|
||||||
{
|
{
|
||||||
if ((hPipe = CreateFile(szPipeName,
|
if ((hPipe = CreateFile(pipe_name,
|
||||||
GENERIC_READ | GENERIC_WRITE,
|
GENERIC_READ | GENERIC_WRITE,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
@ -149,7 +150,7 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host,
|
|||||||
return INVALID_HANDLE_VALUE;
|
return INVALID_HANDLE_VALUE;
|
||||||
}
|
}
|
||||||
/* wait for for an other instance */
|
/* wait for for an other instance */
|
||||||
if (! WaitNamedPipe(szPipeName, connect_timeout*1000) )
|
if (! WaitNamedPipe(pipe_name, connect_timeout*1000) )
|
||||||
{
|
{
|
||||||
net->last_errno=CR_NAMEDPIPEWAIT_ERROR;
|
net->last_errno=CR_NAMEDPIPEWAIT_ERROR;
|
||||||
sprintf(net->last_error,ER(net->last_errno),host, unix_socket,
|
sprintf(net->last_error,ER(net->last_errno),host, unix_socket,
|
||||||
|
@ -189,7 +189,7 @@ static const char* default_dbug_option=IF_WIN("d:t:i:O,\\mysqld.trace",
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __NT__
|
#ifdef __NT__
|
||||||
static char szPipeName [512];
|
static char pipe_name[512];
|
||||||
static SECURITY_ATTRIBUTES saPipeSecurity;
|
static SECURITY_ATTRIBUTES saPipeSecurity;
|
||||||
static SECURITY_DESCRIPTOR sdPipeDescriptor;
|
static SECURITY_DESCRIPTOR sdPipeDescriptor;
|
||||||
static HANDLE hPipe = INVALID_HANDLE_VALUE;
|
static HANDLE hPipe = INVALID_HANDLE_VALUE;
|
||||||
@ -580,7 +580,7 @@ static void close_connections(void)
|
|||||||
DBUG_PRINT( "quit", ("Closing named pipes") );
|
DBUG_PRINT( "quit", ("Closing named pipes") );
|
||||||
|
|
||||||
/* Create connection to the handle named pipe handler to break the loop */
|
/* Create connection to the handle named pipe handler to break the loop */
|
||||||
if ((temp = CreateFile(szPipeName,
|
if ((temp = CreateFile(pipe_name,
|
||||||
GENERIC_READ | GENERIC_WRITE,
|
GENERIC_READ | GENERIC_WRITE,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
@ -588,7 +588,7 @@ static void close_connections(void)
|
|||||||
0,
|
0,
|
||||||
NULL )) != INVALID_HANDLE_VALUE)
|
NULL )) != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
WaitNamedPipe(szPipeName, 1000);
|
WaitNamedPipe(pipe_name, 1000);
|
||||||
DWORD dwMode = PIPE_READMODE_BYTE | PIPE_WAIT;
|
DWORD dwMode = PIPE_READMODE_BYTE | PIPE_WAIT;
|
||||||
SetNamedPipeHandleState(temp, &dwMode, NULL, NULL);
|
SetNamedPipeHandleState(temp, &dwMode, NULL, NULL);
|
||||||
CancelIo(temp);
|
CancelIo(temp);
|
||||||
@ -1173,12 +1173,14 @@ static void server_init(void)
|
|||||||
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)
|
||||||
{
|
{
|
||||||
strxnmov(szPipeName, sizeof(szPipeName), "\\\\.\\pipe\\",
|
|
||||||
unix_socket, NullS);
|
pipe_name[sizeof(pipe_name)-1]= 0; /* Safety if too long string */
|
||||||
ZeroMemory( &saPipeSecurity, sizeof(saPipeSecurity) );
|
strxnmov(pipe_name, sizeof(pipe_name)-1, "\\\\.\\pipe\\",
|
||||||
ZeroMemory( &sdPipeDescriptor, sizeof(sdPipeDescriptor) );
|
unix_socket, NullS);
|
||||||
if ( !InitializeSecurityDescriptor(&sdPipeDescriptor,
|
bzero((char*) &saPipeSecurity, sizeof(saPipeSecurity) );
|
||||||
SECURITY_DESCRIPTOR_REVISION) )
|
bzero((char*) &sdPipeDescriptor, sizeof(sdPipeDescriptor) );
|
||||||
|
if (!InitializeSecurityDescriptor(&sdPipeDescriptor,
|
||||||
|
SECURITY_DESCRIPTOR_REVISION) )
|
||||||
{
|
{
|
||||||
sql_perror("Can't start server : Initialize security descriptor");
|
sql_perror("Can't start server : Initialize security descriptor");
|
||||||
unireg_abort(1);
|
unireg_abort(1);
|
||||||
@ -1191,16 +1193,16 @@ static void server_init(void)
|
|||||||
saPipeSecurity.nLength = sizeof( SECURITY_ATTRIBUTES );
|
saPipeSecurity.nLength = sizeof( SECURITY_ATTRIBUTES );
|
||||||
saPipeSecurity.lpSecurityDescriptor = &sdPipeDescriptor;
|
saPipeSecurity.lpSecurityDescriptor = &sdPipeDescriptor;
|
||||||
saPipeSecurity.bInheritHandle = FALSE;
|
saPipeSecurity.bInheritHandle = FALSE;
|
||||||
if ((hPipe = CreateNamedPipe(szPipeName,
|
if ((hPipe= CreateNamedPipe(pipe_name,
|
||||||
PIPE_ACCESS_DUPLEX,
|
PIPE_ACCESS_DUPLEX,
|
||||||
PIPE_TYPE_BYTE |
|
PIPE_TYPE_BYTE |
|
||||||
PIPE_READMODE_BYTE |
|
PIPE_READMODE_BYTE |
|
||||||
PIPE_WAIT,
|
PIPE_WAIT,
|
||||||
PIPE_UNLIMITED_INSTANCES,
|
PIPE_UNLIMITED_INSTANCES,
|
||||||
(int) global_system_variables.net_buffer_length,
|
(int) global_system_variables.net_buffer_length,
|
||||||
(int) global_system_variables.net_buffer_length,
|
(int) global_system_variables.net_buffer_length,
|
||||||
NMPWAIT_USE_DEFAULT_WAIT,
|
NMPWAIT_USE_DEFAULT_WAIT,
|
||||||
&saPipeSecurity )) == INVALID_HANDLE_VALUE)
|
&saPipeSecurity)) == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
LPVOID lpMsgBuf;
|
LPVOID lpMsgBuf;
|
||||||
int error=GetLastError();
|
int error=GetLastError();
|
||||||
@ -3075,7 +3077,7 @@ extern "C" pthread_handler_decl(handle_connections_namedpipes,arg)
|
|||||||
if (!fConnected)
|
if (!fConnected)
|
||||||
{
|
{
|
||||||
CloseHandle( hPipe );
|
CloseHandle( hPipe );
|
||||||
if ((hPipe = CreateNamedPipe(szPipeName,
|
if ((hPipe = CreateNamedPipe(pipe_name,
|
||||||
PIPE_ACCESS_DUPLEX,
|
PIPE_ACCESS_DUPLEX,
|
||||||
PIPE_TYPE_BYTE |
|
PIPE_TYPE_BYTE |
|
||||||
PIPE_READMODE_BYTE |
|
PIPE_READMODE_BYTE |
|
||||||
@ -3093,7 +3095,7 @@ extern "C" pthread_handler_decl(handle_connections_namedpipes,arg)
|
|||||||
}
|
}
|
||||||
hConnectedPipe = hPipe;
|
hConnectedPipe = hPipe;
|
||||||
/* create new pipe for new connection */
|
/* create new pipe for new connection */
|
||||||
if ((hPipe = CreateNamedPipe(szPipeName,
|
if ((hPipe = CreateNamedPipe(pipe_name,
|
||||||
PIPE_ACCESS_DUPLEX,
|
PIPE_ACCESS_DUPLEX,
|
||||||
PIPE_TYPE_BYTE |
|
PIPE_TYPE_BYTE |
|
||||||
PIPE_READMODE_BYTE |
|
PIPE_READMODE_BYTE |
|
||||||
|
@ -91,7 +91,11 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
|
|||||||
bool is_fifo=0;
|
bool is_fifo=0;
|
||||||
LOAD_FILE_INFO lf_info;
|
LOAD_FILE_INFO lf_info;
|
||||||
char *db = table_list->db; // This is never null
|
char *db = table_list->db; // This is never null
|
||||||
/* If no current database, use database where table is located */
|
/*
|
||||||
|
If path for file is not defined, we will use the current database.
|
||||||
|
If this is not set, we will use the directory where the table to be
|
||||||
|
loaded is located
|
||||||
|
*/
|
||||||
char *tdb= thd->db ? thd->db : db; // Result is never null
|
char *tdb= thd->db ? thd->db : db; // Result is never null
|
||||||
bool transactional_table, log_delayed;
|
bool transactional_table, log_delayed;
|
||||||
ulong skip_lines= ex->skip_lines;
|
ulong skip_lines= ex->skip_lines;
|
||||||
|
@ -150,7 +150,9 @@ int rea_create_table(my_string file_name,
|
|||||||
|
|
||||||
my_free((gptr) screen_buff,MYF(0));
|
my_free((gptr) screen_buff,MYF(0));
|
||||||
my_afree((gptr) keybuff);
|
my_afree((gptr) keybuff);
|
||||||
if (opt_sync_frm && my_sync(file, MYF(MY_WME)))
|
|
||||||
|
if (opt_sync_frm && !(create_info->options & HA_LEX_CREATE_TMP_TABLE) &&
|
||||||
|
my_sync(file, MYF(MY_WME)))
|
||||||
goto err2;
|
goto err2;
|
||||||
if (my_close(file,MYF(MY_WME)) ||
|
if (my_close(file,MYF(MY_WME)) ||
|
||||||
ha_create_table(file_name,create_info,0))
|
ha_create_table(file_name,create_info,0))
|
||||||
|
Reference in New Issue
Block a user