| 3491 | */ |
| 3492 | |
| 3493 | static int send_one_binlog_file(binlog_send_info *info, |
| 3494 | IO_CACHE* log, |
| 3495 | LOG_INFO* linfo, |
| 3496 | my_off_t start_pos) |
| 3497 | { |
| 3498 | mysql_mutex_assert_not_owner(mysql_bin_log.get_log_lock()); |
| 3499 | |
| 3500 | /* seek to the requested position, to start the requested dump */ |
| 3501 | if (!opt_binlog_engine_hton && |
| 3502 | start_pos != BIN_LOG_HEADER_SIZE) |
| 3503 | { |
| 3504 | my_b_seek(log, start_pos); |
| 3505 | linfo->pos= start_pos; |
| 3506 | } |
| 3507 | |
| 3508 | /* Counter used by can_purge_log() */ |
| 3509 | sending_new_binlog_file++; |
| 3510 | while (!should_stop(info)) |
| 3511 | { |
| 3512 | if (opt_binlog_engine_hton) |
| 3513 | { |
| 3514 | info->dirlen= 0; |
| 3515 | if (send_engine_events(info, linfo)) |
| 3516 | return 1; |
| 3517 | } |
| 3518 | else |
| 3519 | { |
| 3520 | /** |
| 3521 | * get end pos of current log file, this function |
| 3522 | * will wait if there is nothing available |
| 3523 | */ |
| 3524 | my_off_t end_pos= get_binlog_end_pos(info, log, linfo); |
| 3525 | if (end_pos <= 1) |
| 3526 | { |
| 3527 | /** end of file or error */ |
| 3528 | return (int)end_pos; |
| 3529 | } |
| 3530 | info->dirlen= dirname_length(info->log_file_name); |
| 3531 | /** |
| 3532 | * send events from current position up to end_pos |
| 3533 | */ |
| 3534 | if (send_events(info, log, linfo, end_pos)) |
| 3535 | return 1; |
| 3536 | } |
| 3537 | } |
| 3538 | |
| 3539 | return 1; |
| 3540 | } |
| 3541 | |
| 3542 | void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, |
| 3543 | ushort flags) |
no test coverage detected