Load the current GTID position into a slave_connection_state, for use when connecting to a master server with GTID. If the flag use_binlog is true, then the contents of the binary log (if enabled) is merged into the current GTID state (master_use_gtid=current_pos). */
| 5702 | enabled) is merged into the current GTID state (master_use_gtid=current_pos). |
| 5703 | */ |
| 5704 | int |
| 5705 | rpl_load_gtid_state(slave_connection_state *state, bool use_binlog) |
| 5706 | { |
| 5707 | int err; |
| 5708 | rpl_gtid *gtid_list= NULL; |
| 5709 | uint32 num_gtids= 0; |
| 5710 | |
| 5711 | if (use_binlog && opt_bin_log && |
| 5712 | (err= mysql_bin_log.get_most_recent_gtid_list(>id_list, &num_gtids))) |
| 5713 | return err; |
| 5714 | |
| 5715 | err= state->load(rpl_global_gtid_slave_state, gtid_list, num_gtids); |
| 5716 | my_free(gtid_list); |
| 5717 | |
| 5718 | return err; |
| 5719 | } |
| 5720 | |
| 5721 | |
| 5722 | bool |
no test coverage detected