| 2284 | |
| 2285 | |
| 2286 | static void update_file_path(MYSQL_THD thd, st_mysql_sys_var *, void *, |
| 2287 | const void *save) |
| 2288 | { |
| 2289 | char *new_name= *static_cast<char*const*>(save); |
| 2290 | if (!new_name) |
| 2291 | new_name= empty_str; |
| 2292 | else if (strlen(new_name) + 4 > FN_REFLEN) |
| 2293 | { |
| 2294 | error_header(); |
| 2295 | fprintf(stderr, |
| 2296 | "server_audit_file_path can't exceed %d characters.\n", |
| 2297 | FN_REFLEN - 4); |
| 2298 | fprintf(stderr, "Log filename remains unchanged '%s'.\n", file_path); |
| 2299 | CLIENT_ERROR(1, "server_audit_file_path can't exceed %d characters.", |
| 2300 | MYF(ME_WARNING), FN_REFLEN - 4); |
| 2301 | return; |
| 2302 | } |
| 2303 | |
| 2304 | lock_operations.wr_lock(); |
| 2305 | internal_stop_logging++; |
| 2306 | error_header(); |
| 2307 | fprintf(stderr, "Log file name was changed to '%s'.\n", new_name); |
| 2308 | |
| 2309 | if (logging) |
| 2310 | log_current_query(thd); |
| 2311 | |
| 2312 | if (logging && output_type == OUTPUT_FILE) |
| 2313 | { |
| 2314 | char *sav_path= file_path; |
| 2315 | |
| 2316 | file_path= new_name; |
| 2317 | stop_logging(); |
| 2318 | if (start_logging()) |
| 2319 | { |
| 2320 | file_path= sav_path; |
| 2321 | error_header(); |
| 2322 | fprintf(stderr, "Reverting log filename back to '%s'.\n", file_path); |
| 2323 | logging= (start_logging() == 0); |
| 2324 | if (!logging) |
| 2325 | { |
| 2326 | error_header(); |
| 2327 | fprintf(stderr, "Logging was disabled..\n"); |
| 2328 | CLIENT_ERROR(1, "Logging was disabled.", MYF(ME_WARNING)); |
| 2329 | } |
| 2330 | goto exit_func; |
| 2331 | } |
| 2332 | } |
| 2333 | |
| 2334 | strncpy(path_buffer, new_name, sizeof(path_buffer)-1); |
| 2335 | path_buffer[sizeof(path_buffer)-1]= 0; |
| 2336 | file_path= path_buffer; |
| 2337 | exit_func: |
| 2338 | internal_stop_logging--; |
| 2339 | lock_operations.wr_unlock(); |
| 2340 | } |
| 2341 | |
| 2342 | |
| 2343 | static int check_timestamp_format(MYSQL_THD thd, st_mysql_sys_var *, |
nothing calls this directly
no test coverage detected