diff -rc --exclude='*.orig' --exclude=sql_yacc.h --exclude=sql_yacc.cc mysql-5.6.16/CMakeLists.txt mysql-5.6.16-patched/CMakeLists.txt *** mysql-5.6.16/CMakeLists.txt 2014-01-14 23:38:00.000000000 +0800 --- mysql-5.6.16-patched/CMakeLists.txt 2014-06-22 08:29:05.000000000 +0800 *************** *** 479,486 **** ADD_SUBDIRECTORY(libmysqld/examples) ENDIF(WITH_EMBEDDED_SERVER) ! ADD_SUBDIRECTORY(mysql-test) ! ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess) ADD_SUBDIRECTORY(support-files) ADD_SUBDIRECTORY(scripts) ADD_SUBDIRECTORY(sql-bench) --- 479,486 ---- ADD_SUBDIRECTORY(libmysqld/examples) ENDIF(WITH_EMBEDDED_SERVER) ! # ADD_SUBDIRECTORY(mysql-test) ! # ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess) ADD_SUBDIRECTORY(support-files) ADD_SUBDIRECTORY(scripts) ADD_SUBDIRECTORY(sql-bench) 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 09:03:06.000000000 +0800 *************** *** 771,774 **** --- 771,790 ---- end: DBUG_RETURN(error); } + + /** + return the file index number from file name + */ + inline uint get_binary_log_index(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);