On 5/11/11 5:00 AM, Jon Olav Hauglid wrote:
> #Atfile:///export/home/x/mysql-trunk-insert_delayed_valgrind/ based
> onrevid:georgi.kodinov@stripped
>
> 3392 Jon Olav Hauglid 2011-05-11
> Bug#12538873 BINLOG.BINLOG_STM_BINLOG FAILS IN VALGRIND
> DUE TO INSERT DELAYED
>
> The problem was that not all allocated memory was freed
> when INSERT DELAYED was used with binlogging on.
>
> When an instance of the Delayed_insert class is made, it's
> query string is set to a copy of the table name. The same
> string is also used for Delayed_insert's TABLE_LIST. The string
> is later freed in Delayed_insert's destructor. The problem
> was that the pointer to this string was overwritten during
> INSERT DELAYED processing if binlogging was on. This caused
> the original query string to never be freed which caused the
> Valgrind warning. This was a regression introduced by WL#4033.
>
> This patch fixes the problem by changing the Delayed_insert's
> destructor to instead free the string using the pointer from
> Delayed_insert's TABLE_LIST.
>
> No test case added since the problem is already covered by
> binlog.binlog_stm_binlog.test running with Valgrind.
OK to push.