Dao-Gang.Qu@stripped writes:
> #At file:///home/daogangqu/mysql/bzrwork/wl4033/mysql-5.1-rep%2B2/ based on
> revid:li-bing.song@stripped
>
> 3185 Dao-Gang.Qu@stripped 2010-04-23
> WL#344 Support for informational log events
Just a quick comment:
> - DBUG_RETURN(0);
> + {
> + /* Write the 'query' information even into binlog with its row event */
> + LEX_STRING const query_msg= { const_cast<char*>(query_arg), query_len
> };
> + DBUG_RETURN(mysql_bin_log.write_information(this, query_msg, TRUE));
> + }
> +void
> +Informational_event::print(FILE *file,
> + PRINT_EVENT_INFO *print_event_info)
> +{
> + if (print_event_info->short_form)
> + return;
> +
> + Write_on_release_cache cache(&print_event_info->head_cache, file);
> + print_header(&cache, print_event_info, FALSE);
> + my_b_printf(&cache, "\tInformation\n");
> + my_b_printf(&cache, "# m_message: %s\n", m_message.str);
> +}
What happens if the query_arg includes newlines? It seems that this will cause
mysqlbinlog to output non-comment lines containing trailing parts of the
queries, causing a later attempt to feed such output to `mysql` to fail or
even corrupt the database.
Also, there seems to be no test case for mysqlbinlog for this ...
- Kristian.