diff -rc --exclude='*.orig' --exclude=sql_yacc.h --exclude=sql_yacc.cc mysql-5.6.16/sql/binlog.h mysql-5.6.16-patched/sql/binlog.h *** mysql-5.6.16/sql/binlog.h 2014-01-14 23:38:00.000000000 +0800 --- mysql-5.6.16-patched/sql/binlog.h 2014-06-22 11:33:37.000000000 +0800 *************** *** 771,774 **** --- 771,790 ---- end: DBUG_RETURN(error); } + + /** + return the file index number from file name + */ + inline uint get_binary_log_index(const char *fname) + { + uint lindex = 0; + size_t len = strlen(fname); + + while(len & fname[len - 1] >= '0' && fname[len - 1] <= '9') len --; + while(fname[len] == '0') len ++; + + lindex = atoi(fname + len - 1); + + return lindex; + } #endif /* BINLOG_H_INCLUDED */ diff -rc --exclude='*.orig' --exclude=sql_yacc.h --exclude=sql_yacc.cc mysql-5.6.16/sql/rpl_master.cc mysql-5.6.16-patched/sql/rpl_master.cc *** mysql-5.6.16/sql/rpl_master.cc 2014-01-14 23:38:00.000000000 +0800 --- mysql-5.6.16-patched/sql/rpl_master.cc 2014-06-22 08:43:23.000000000 +0800 *************** *** 1951,1956 **** --- 1951,1960 ---- field_list.push_back(new Item_empty_string("File", FN_REFLEN)); field_list.push_back(new Item_return_int("Position",20, MYSQL_TYPE_LONGLONG)); + + field_list.push_back(new Item_return_int("Long_Position",20, + MYSQL_TYPE_LONGLONG)); + field_list.push_back(new Item_empty_string("Binlog_Do_DB",255)); field_list.push_back(new Item_empty_string("Binlog_Ignore_DB",255)); field_list.push_back(new Item_empty_string("Executed_Gtid_Set", *************** *** 1966,1976 **** --- 1970,1986 ---- if (mysql_bin_log.is_open()) { + ulonglong longpos=0; LOG_INFO li; mysql_bin_log.get_current_log(&li); int dir_len = dirname_length(li.log_file_name); protocol->store(li.log_file_name + dir_len, &my_charset_bin); protocol->store((ulonglong) li.pos); + + longpos = get_binary_log_index(li.log_file_name + dir_len); + longpos = longpos * max_binlog_size + li.pos; + protocol->store(longpos); + protocol->store(binlog_filter->get_do_db()); protocol->store(binlog_filter->get_ignore_db()); protocol->store(gtid_set_buffer, &my_charset_bin); diff -rc --exclude='*.orig' --exclude=sql_yacc.h --exclude=sql_yacc.cc mysql-5.6.16/sql/rpl_slave.cc mysql-5.6.16-patched/sql/rpl_slave.cc *** mysql-5.6.16/sql/rpl_slave.cc 2014-01-14 23:38:00.000000000 +0800 --- mysql-5.6.16-patched/sql/rpl_slave.cc 2014-06-22 11:30:14.000000000 +0800 *************** *** 2575,2580 **** --- 2575,2584 ---- FN_REFLEN)); field_list.push_back(new Item_return_int("Read_Master_Log_Pos", 10, MYSQL_TYPE_LONGLONG)); + + field_list.push_back(new Item_return_int("Read_Master_Long_Pos", 12, + MYSQL_TYPE_LONGLONG)); + field_list.push_back(new Item_empty_string("Relay_Log_File", FN_REFLEN)); field_list.push_back(new Item_return_int("Relay_Log_Pos", 10, *************** *** 2596,2601 **** --- 2600,2609 ---- MYSQL_TYPE_LONG)); field_list.push_back(new Item_return_int("Exec_Master_Log_Pos", 10, MYSQL_TYPE_LONGLONG)); + + field_list.push_back(new Item_return_int("Exec_Master_Long_Pos", 12, + MYSQL_TYPE_LONGLONG)); + field_list.push_back(new Item_return_int("Relay_Log_Space", 10, MYSQL_TYPE_LONGLONG)); field_list.push_back(new Item_empty_string("Until_Condition", 6)); *************** *** 2660,2665 **** --- 2668,2674 ---- { DBUG_PRINT("info",("host is set: '%s'", mi->host)); String *packet= &thd->packet; + ulonglong longpos = 0; protocol->prepare_for_resend(); /* *************** *** 2686,2691 **** --- 2695,2705 ---- protocol->store((uint32) mi->connect_retry); protocol->store(mi->get_master_log_name(), &my_charset_bin); protocol->store((ulonglong) mi->get_master_log_pos()); + + longpos = get_binary_log_index(mi->get_master_log_name()); + longpos = longpos * max_binlog_size + mi->get_master_log_pos(); + protocol->store(longpos); + protocol->store(mi->rli->get_group_relay_log_name() + dirname_length(mi->rli->get_group_relay_log_name()), &my_charset_bin); *************** *** 2713,2718 **** --- 2727,2737 ---- protocol->store(mi->rli->last_error().message, &my_charset_bin); protocol->store((uint32) mi->rli->slave_skip_counter); protocol->store((ulonglong) mi->rli->get_group_master_log_pos()); + + longpos = get_binary_log_index(mi->rli->get_group_master_log_name()); + longpos = longpos * max_binlog_size + mi->rli->get_group_master_log_pos(); + protocol->store(longpos); + protocol->store((ulonglong) mi->rli->log_space_total); const char *until_type= "";