From: Sergey Vojtovich Date: December 2 2010 2:04pm Subject: Re: bzr commit into mysql-trunk branch (Li-Bing.Song:3350) Bug#48183 List-Archive: http://lists.mysql.com/commits/125813 Message-Id: <20101202140408.GA542@june> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Hi Li-Bing, On Thu, Dec 02, 2010 at 12:44:00PM +0800, Libing Song wrote: ...skip... > > > > Also, being non-replication guy, I'm a bit confused: you set unsafe > > > > warning flag, but you don't really mark statement unsafe? If it is > > > > done implicitely, could you point me to that code? > > > binlog_query() calls issue_unsafe_warnings(). issue_unsafe_warnings() > > > checks this flag and then generates different unsafe warnings. > > Right, it generates different unsafe warnings. But I don't see how it > > marks statement unsafe. > First, lex->set_stmt_unsafe() are called by yacc.yy and some functions > (eg. uuid, rand)when they are initializing. Right. But we don't call set_stmt_unsafe() for MATCH()? > Second, after opening all tables related to a statement, > decide_logging_format() are called to decide what binlog format should > be used in current statement. > decide_logging_format() will copy the unsafe flags marked by > lex->set_stmt_unsafe to thd->binlog_unsafe_warning_flags if > the statement has to be binlogged in statement format. Please don't be blocked by this question. I'm just trying to educate myself. Could you correct me where I'm wrong: I read bug report and I see that unsafe statements are to be logged in row format if binlog_format=mixed or cause a warning to be generated if binlog_format=statement. Also I see that it is suggested to mark MATCH() using plugin unsafe. I read your patch and see that a warning is generated if binlog_format is statement. I can see that you achieve it by setting binlog_unsafe_warning_flags. But in mixed mode you still log MATCH() in statement format, because binlog_stmt_flags is unaffected. It is contradicting to the requirement listed in the bug report. Probably it is a good idea to test mixed mode as well. At least to avoid questions like this. Regards, Sergey -- Sergey Vojtovich MySQL AB, Software Engineer Izhevsk, Russia, www.mysql.com