@todo The following should be using fn_format(); We just need to first change fn_format() to cut the file name if it's too long. */
| 1220 | first change fn_format() to cut the file name if it's too long. |
| 1221 | */ |
| 1222 | const char *MYSQL_LOG::generate_name(const char *log_name, |
| 1223 | const char *suffix, |
| 1224 | bool strip_ext, char *buff) |
| 1225 | { |
| 1226 | if (!log_name || !log_name[0]) |
| 1227 | { |
| 1228 | strmake(buff, pidfile_name, FN_REFLEN - strlen(suffix) - 1); |
| 1229 | return (const char *) |
| 1230 | fn_format(buff, buff, "", suffix, MYF(MY_REPLACE_EXT|MY_REPLACE_DIR)); |
| 1231 | } |
| 1232 | // get rid of extension if the log is binary to avoid problems |
| 1233 | if (strip_ext) |
| 1234 | { |
| 1235 | char *p= fn_ext(log_name); |
| 1236 | uint length= (uint) (p - log_name); |
| 1237 | strmake(buff, log_name, min<size_t>(length, FN_REFLEN-1)); |
| 1238 | return (const char*)buff; |
| 1239 | } |
| 1240 | return log_name; |
| 1241 | } |
| 1242 | |
| 1243 | |
| 1244 | int error_log_print(enum loglevel level, const char *format, |