Merge mysql.com:/misc/mysql/31752_/41-31752_

into  mysql.com:/misc/mysql/31752_/50-31752_
parents 883338a9 dddced96
...@@ -271,7 +271,7 @@ void symdirget(char *dir) ...@@ -271,7 +271,7 @@ void symdirget(char *dir)
SYNOPSIS SYNOPSIS
unpack_dirname() unpack_dirname()
to Store result here. May be = from to result-buffer, FN_REFLEN characters. may be == from
from 'Packed' directory name (may contain ~) from 'Packed' directory name (may contain ~)
IMPLEMENTATION IMPLEMENTATION
...@@ -397,7 +397,7 @@ uint unpack_filename(my_string to, const char *from) ...@@ -397,7 +397,7 @@ uint unpack_filename(my_string to, const char *from)
/* Convert filename (unix standard) to system standard */ /* Convert filename (unix standard) to system standard */
/* Used before system command's like open(), create() .. */ /* Used before system command's like open(), create() .. */
/* Returns length of to */ /* Returns used length of to; total length should be FN_REFLEN */
uint system_filename(my_string to, const char *from) uint system_filename(my_string to, const char *from)
{ {
......
...@@ -1287,7 +1287,7 @@ int MYSQL_LOG::purge_logs_before_date(time_t purge_time) ...@@ -1287,7 +1287,7 @@ int MYSQL_LOG::purge_logs_before_date(time_t purge_time)
void MYSQL_LOG::make_log_name(char* buf, const char* log_ident) void MYSQL_LOG::make_log_name(char* buf, const char* log_ident)
{ {
uint dir_len = dirname_length(log_file_name); uint dir_len = dirname_length(log_file_name);
if (dir_len > FN_REFLEN) if (dir_len >= FN_REFLEN)
dir_len=FN_REFLEN-1; dir_len=FN_REFLEN-1;
strnmov(buf, log_file_name, dir_len); strnmov(buf, log_file_name, dir_len);
strmake(buf+dir_len, log_ident, FN_REFLEN - dir_len -1); strmake(buf+dir_len, log_ident, FN_REFLEN - dir_len -1);
......
...@@ -166,6 +166,11 @@ bool mysql_create_frm(THD *thd, my_string file_name, ...@@ -166,6 +166,11 @@ bool mysql_create_frm(THD *thd, my_string file_name,
create_info->comment.str : "", create_info->comment.length); create_info->comment.str : "", create_info->comment.length);
forminfo[46]=(uchar) create_info->comment.length; forminfo[46]=(uchar) create_info->comment.length;
#ifdef EXTRA_DEBUG #ifdef EXTRA_DEBUG
/*
EXTRA_DEBUG causes strmake() to initialize its buffer behind the
payload with a magic value to detect wrong buffer-sizes. We
explicitly zero that segment again.
*/
memset((char*) forminfo+47 + forminfo[46], 0, 61 - forminfo[46]); memset((char*) forminfo+47 + forminfo[46], 0, 61 - forminfo[46]);
#endif #endif
if (my_pwrite(file,(byte*) fileinfo,64,0L,MYF_RW) || if (my_pwrite(file,(byte*) fileinfo,64,0L,MYF_RW) ||
......
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