List:Commits« Previous MessageNext Message »
From:Kristofer Pettersson Date:September 29 2009 3:06pm
Subject:bzr commit into mysql-5.0-bugteam branch (kristofer.pettersson:2809)
Bug#42108
View as plain text  
#At file:///Users/thek/Development/50-bug42108/ based on revid:sergey.glukhov@stripped

 2809 Kristofer Pettersson	2009-09-29
      Bug#42108 Wrong locking for UPDATE with subqueries leads to broken statement
                replication
                    
      MySQL server uses wrong lock type (always TL_READ instead of
      TL_READ_NO_INSERT when appropriate) for tables used in
      subqueries of UPDATE statement. This leads in some cases to
      a broken replication as statements are written in the wrong
      order to the binlog.
     @ sql/sql_yacc.yy
        * Set lock_option to either TL_READ_NO_INSERT or
          TL_READ for any sub-SELECT following UPDATE.
        * Changed line adjusted for parser identation
          rules; code begins at column 13.

    modified:
      sql/sql_yacc.yy
=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2009-08-27 10:22:19 +0000
+++ b/sql/sql_yacc.yy	2009-09-29 15:06:51 +0000
@@ -7810,7 +7810,7 @@ update:
 	  LEX *lex= Lex;
 	  mysql_init_select(lex);
           lex->sql_command= SQLCOM_UPDATE;
-	  lex->lock_option= TL_UNLOCK; 	/* Will be set later */
+            lex->lock_option= using_update_log ? TL_READ_NO_INSERT : TL_READ;
 	  lex->duplicates= DUP_ERROR; 
         }
         opt_low_priority opt_ignore join_table_list


Attachment: [text/bzr-bundle]
Thread
bzr commit into mysql-5.0-bugteam branch (kristofer.pettersson:2809)Bug#42108Kristofer Pettersson29 Sep