-
unknown authored
This patch corrects a problem encountered when reading the binlog from a remote host. The application was crashing because the buffer variable (temp_buf) in log_event was not pointing to the incoming data. For a normal file read, this buffer is allocated by a previous call of read_log_event. However, when reading from a remote host, the first call to read_log_event is not executed therefore no buffer is allocated. Furthermore, there is no need to allocate a new buffer because the incoming stream is what needs to be read. This patch adds the call to initialize the temp_buf variable if reading from a remote host. It also adds a check at destroy time to ensure the temp_buf is not freed if reading from a remote host. client/mysqlbinlog.cc: BUG#17654 : --read-from-remote-server causes core This patch corrects a problem when reading from a remote host. The temp_buf variable of the log_event class is undefined. This patch assigns the temp_buf variable to the address of the incoming stream. This allows the print functions to print the binlog events correctly. mysql-test/r/rpl_row_mysqlbinlog.result: BUG#17654 : --read-from-remote-server causes core This patch adds the results for the test that were disabled when the bug report was investigated. The patch also adds an additional test was added to ensure the output of reading from a remote host is the same as reading from a local file. mysql-test/t/rpl_row_mysqlbinlog.test: BUG#17654 : --read-from-remote-server causes core This patch enables the portions of the test that were disabled when the bug report was investigated. The patch also adds an additional test was added to ensure the output of reading from a remote host is the same as reading from a local file.
82f4b06e