--- src/tcp_driver.cpp.orig 2013-11-11 08:28:44.068895214 +0100 +++ src/tcp_driver.cpp 2013-11-11 08:29:28.654566644 +0100 @@ -146,7 +146,6 @@ long offset) { - char *binlog_name= ""; char *binlog_pos; ushort binlog_flags= 0; uchar buf[1024]; --- src/binary_log.cpp.orig 2013-11-11 08:30:04.684686153 +0100 +++ src/binary_log.cpp 2013-11-11 08:30:43.446663057 +0100 @@ -34,15 +34,14 @@ */ const char* str_error(int error_no) { - char *msg= NULL; if (error_no != ERR_OK) { if ((error_no > ERR_OK) && (error_no < ERROR_CODE_COUNT)) - msg= (char*)bapi_error_messages[error_no]; + return (const char*)bapi_error_messages[error_no]; else - msg= "Unknown error"; + return "Unknown error"; } - return msg; + return NULL; } Binary_log::Binary_log(Binary_log_driver *drv) : m_binlog_position(4), --- ./include/tcp_driver.h.orig 2013-11-11 09:03:59.439463950 +0100 +++ ./include/tcp_driver.h 2013-11-11 09:13:57.011274196 +0100 @@ -43,11 +43,11 @@ { public: - Binlog_tcp_driver(const std::string& user, const std::string& passwd, - const std::string& host, uint port) - : Binary_log_driver("", 4), m_host(host), m_user(user), m_passwd(passwd), - m_port(port), m_waiting_event(0), - m_total_bytes_transferred(0), m_shutdown(false) + Binlog_tcp_driver(const std::string& user_name, const std::string& passwd, + const std::string& host_name, uint tcp_port) + : Binary_log_driver("", 4), m_shutdown(false), m_waiting_event(0), + m_user(user_name), m_host(host_name), m_passwd(passwd), m_port(tcp_port), + m_total_bytes_transferred(0) { } --- ./include/protocol.h.orig 2013-11-11 08:43:22.448044734 +0100 +++ ./include/protocol.h 2013-11-11 09:14:57.131136130 +0100 @@ -139,6 +139,9 @@ { public: Protocol() { m_length_encoded_binary= false; } + + virtual ~Protocol() {} + /** Return the number of bytes which is read or written by this protocol chunk. The default size is equal to the underlying storage data type. @@ -206,10 +209,10 @@ * @note If size == 0 then the chunk is a * length coded binary. */ - Protocol_chunk(T *buffer, unsigned long size) : Protocol () + Protocol_chunk(T *buffer, unsigned long sz) : Protocol () { m_data= (const char *)buffer; - m_size= size; + m_size= sz; } virtual unsigned int size() { return m_size; } @@ -217,7 +220,7 @@ virtual void collapse_size(unsigned int new_size) { //assert(new_size <= m_size); - memset((char *)m_data+new_size,'\0', m_size-new_size); + memset(const_cast(m_data)+new_size,'\0', m_size-new_size); m_size= new_size; } private: @@ -232,11 +235,12 @@ class Protocol_chunk_string //: public Protocol_chunk_uint8 { public: - Protocol_chunk_string(std::string &chunk, unsigned long size) + Protocol_chunk_string(std::string &chunk, unsigned long sz) { m_str= &chunk; - m_str->assign(size,'*'); + m_str->assign(sz,'*'); } + virtual ~Protocol_chunk_string() { } virtual unsigned int size() const { return m_str->size(); } virtual const char *data() const { return m_str->data(); } @@ -252,12 +256,12 @@ class Protocol_chunk_vector : public Protocol_chunk_uint8 { public: - Protocol_chunk_vector(std::vector &chunk, unsigned long size) + Protocol_chunk_vector(std::vector &chunk, unsigned long sz) : Protocol_chunk_uint8() { m_vec= &chunk; - m_vec->reserve(size); - m_size= size; + m_vec->reserve(sz); + m_size= sz; } virtual unsigned int size() { return m_vec->size(); } --- ./include/basic_transaction_parser.h.orig 2013-11-11 08:59:38.661079047 +0100 +++ ./include/basic_transaction_parser.h 2013-11-11 09:00:06.053648850 +0100 @@ -50,8 +50,8 @@ : Binary_log_event() { } - Transaction_log_event(Log_event_header *header) - : Binary_log_event(header) {} + Transaction_log_event(Log_event_header *leh) + : Binary_log_event(leh) {} virtual ~Transaction_log_event(); Int_to_Event_map &table_map() { return m_table_map; } --- ./include/value.h.orig 2013-11-11 09:00:40.306860373 +0100 +++ ./include/value.h 2013-11-11 09:02:57.487697695 +0100 @@ -58,12 +58,12 @@ class Value { public: - Value(enum_field_types type, uint32_t metadata, const char *storage) : - m_type(type), m_storage(storage), m_metadata(metadata), m_is_null(false) + Value(enum_field_types value_type, uint32_t metadata_coded, const char *value_storage) : + m_type(value_type), m_storage(value_storage), m_metadata(metadata_coded), m_is_null(false) { - m_size= calc_field_size((unsigned char)type, - (const unsigned char*)storage, - metadata); + m_size= calc_field_size((unsigned char)value_type, + (const unsigned char*)value_storage, + metadata_coded); }; Value() --- ./include/field_iterator.h.orig 2013-11-11 08:58:53.535435147 +0100 +++ ./include/field_iterator.h 2013-11-11 08:59:10.935526649 +0100 @@ -48,8 +48,8 @@ { } Row_event_iterator(const Row_event *row_event, - const Table_map_event *table_map) - : m_row_event(row_event), m_table_map(table_map), + const Table_map_event *tmap) + : m_row_event(row_event), m_table_map(tmap), m_new_field_offset_calculated(0) { m_field_offset= 0; --- ./include/binlog_api.h.orig 2013-11-11 08:37:25.073699824 +0100 +++ ./include/binlog_api.h 2013-11-11 08:55:45.843234735 +0100 @@ -55,26 +55,6 @@ ERROR_CODE_COUNT }; -/** - *Errors you can get from the API - */ -static const char *bapi_error_messages[]= -{ - "All OK", - "End of File", - "Unexpected failure", - "binlog_checksum is enabled on the master. Set them to NONE.", - "Could not notify master about checksum awareness.\n" - "Master returned no rows for the query\n" - "SHOW GLOBAL VARIABLES LIKE 'BINLOG_CHECKSUM.", - "Unable to set up connection", - "Binlog Version not supported", - "Error in packet length. Binlog checksums may be enabled on the master.\n" - "Please set it to NONE.", - "Error in executing MySQL Query on the server", - "" -}; - extern const char *str_error(int error_no); /** @@ -94,20 +74,27 @@ virtual int wait_for_next_event(mysql::Binary_log_event **event) { + (void) event; return ERR_EOF; } virtual int set_position(const std::string &str, unsigned long position) { + (void) str; + (void) position; return ERR_OK; } virtual int get_position(std::string *str, unsigned long *position) { + (void) str; + (void) position; return ERR_OK; } virtual int connect(const std::string &filename, ulong position) { + (void) filename; + (void) position; return ERR_OK; } virtual int disconnect() --- ./include/binlog_driver.h.orig 2013-11-11 08:53:43.118642128 +0100 +++ ./include/binlog_driver.h 2013-11-11 09:03:30.434977731 +0100 @@ -33,11 +33,11 @@ template Binary_log_driver(const FilenameT& filename = FilenameT(), unsigned int offset = 0) - : m_binlog_file_name(filename), m_binlog_offset(offset) + : m_binlog_offset(offset), m_binlog_file_name(filename) { } - ~Binary_log_driver() {} + virtual ~Binary_log_driver() {} /** * Connect to the binary log using previously declared connection parameters --- ./src/binary_log.cpp.orig 2013-11-11 08:39:30.039176746 +0100 +++ ./src/binary_log.cpp 2013-11-11 08:51:38.089169692 +0100 @@ -25,6 +25,27 @@ using namespace mysql::system; namespace mysql { + +/** + *Errors you can get from the API + */ +static const char *bapi_error_messages[]= +{ + "All OK", + "End of File", + "Unexpected failure", + "binlog_checksum is enabled on the master. Set them to NONE.", + "Could not notify master about checksum awareness.\n" + "Master returned no rows for the query\n" + "SHOW GLOBAL VARIABLES LIKE 'BINLOG_CHECKSUM.", + "Unable to set up connection", + "Binlog Version not supported", + "Error in packet length. Binlog checksums may be enabled on the master.\n" + "Please set it to NONE.", + "Error in executing MySQL Query on the server", + "" +}; + /* Get a string describing an error from BAPI. --- ./include/binlog_event.h.orig 2013-11-11 09:20:57.089345795 +0100 +++ ./include/binlog_event.h 2013-11-11 09:23:41.800743092 +0100 @@ -168,9 +168,9 @@ m_header.type_code= 0; } - Binary_log_event(Log_event_header *header) + Binary_log_event(Log_event_header *log_event_header) { - m_header= *header; + m_header= *log_event_header; } /** @@ -203,7 +203,7 @@ class Unknown_event: public Binary_log_event { public: - Unknown_event(Log_event_header *header) : Binary_log_event(header) {} + Unknown_event(Log_event_header *log_event_header) : Binary_log_event(log_event_header) {} void print_event_info(std::ostream& info); void print_long_info(std::ostream& info); @@ -212,7 +212,7 @@ class Query_event: public Binary_log_event { public: - Query_event(Log_event_header *header) : Binary_log_event(header) {} + Query_event(Log_event_header *log_event_header) : Binary_log_event(log_event_header) {} uint32_t thread_id; uint32_t exec_time; uint16_t error_code; @@ -228,7 +228,7 @@ class Rotate_event: public Binary_log_event { public: - Rotate_event(Log_event_header *header) : Binary_log_event(header) {} + Rotate_event(Log_event_header *log_event_header) : Binary_log_event(log_event_header) {} std::string binlog_file; uint64_t binlog_pos; @@ -238,7 +238,7 @@ class Format_event: public Binary_log_event { public: - Format_event(Log_event_header *header) : Binary_log_event(header) {} + Format_event(Log_event_header *log_event_header) : Binary_log_event(log_event_header) {} uint16_t binlog_version; std::string master_version; uint32_t created_ts; @@ -263,7 +263,7 @@ VALUE_TYPE_COUNT }; - User_var_event(Log_event_header *header) : Binary_log_event(header) {} + User_var_event(Log_event_header *log_event_header) : Binary_log_event(log_event_header) {} std::string name; uint8_t is_null; uint8_t type; @@ -290,7 +290,7 @@ class Table_map_event: public Binary_log_event { public: - Table_map_event(Log_event_header *header) : Binary_log_event(header) {} + Table_map_event(Log_event_header *log_event_header) : Binary_log_event(log_event_header) {} uint64_t table_id; uint16_t flags; std::string db_name; @@ -322,7 +322,7 @@ COMPLETE_ROWS_F = (1U << 3) }; - Row_event(Log_event_header *header) : Binary_log_event(header) {} + Row_event(Log_event_header *log_event_header) : Binary_log_event(log_event_header) {} uint64_t table_id; uint16_t flags; uint64_t columns_len; @@ -355,7 +355,7 @@ class Int_var_event: public Binary_log_event { public: - Int_var_event(Log_event_header *header) : Binary_log_event(header) {} + Int_var_event(Log_event_header *log_event_header) : Binary_log_event(log_event_header) {} uint8_t type; uint64_t value; enum Int_event_type @@ -388,7 +388,7 @@ { public: Incident_event() : Binary_log_event() {} - Incident_event(Log_event_header *header) : Binary_log_event(header) {} + Incident_event(Log_event_header *log_event_header) : Binary_log_event(log_event_header) {} uint8_t type; std::string message; @@ -399,7 +399,7 @@ class Xid: public Binary_log_event { public: - Xid(Log_event_header *header) : Binary_log_event(header) {} + Xid(Log_event_header *log_event_header) : Binary_log_event(log_event_header) {} uint64_t xid_id; void print_event_info(std::ostream& info);