There is no need to mark the statement as unsafe because
this will cause warning messages in the statement mode that
are not true.
So, I think you just need to check if it is not statement mode
and then switch to row.
On 07/19/2010 08:31 AM, Dao-Gang.Qu@stripped wrote:
> #At file:///home/daogangqu/mysql/bzrwork1/bug34283/mysql-5.1-bugteam/ based on
> 3470 Dao-Gang.Qu@stripped 2010-07-19
> Bug #34283 mysqlbinlog leaves tmpfile after termination if binlog contains
> load data infile
> With statement- or mixed-mode logging, "LOAD DATA INFILE" queries
> are written to the binlog using special types of log events.
> When mysqlbinlog reads such events, it re-creates the file in a
> temporary directory with a generated filename and outputs a
> "LOAD DATA INFILE" query where the filename is replaced by the
> generated file. The temporary file is not deleted by mysqlbinlog
> after termination.
> To fix the problem, in mixed mode we go to row-based. In SBR, we
> document it to remind user the tmpfile is left in a temporary
> @ sql/sql_load.cc
> Added code to go to row-based in mixed mode for
> 'load data infile ...' statement
> + /*
> + Bug #34283
> + mysqlbinlog leaves tmpfile after termination if binlog contains
> + load data infile, so in mixed mode we go to row-based for
> + avoiding the problem.
> + */
> + thd->lex->set_stmt_unsafe();
> + thd->set_current_stmt_binlog_row_based_if_mixed();
> #ifdef EMBEDDED_LIBRARY
> read_file_from_client = 0; //server is always in the same process