diff options
author | Kristofer Pettersson <kristofer.pettersson@sun.com> | 2009-09-29 17:06:51 +0200 |
---|---|---|
committer | Kristofer Pettersson <kristofer.pettersson@sun.com> | 2009-09-29 17:06:51 +0200 |
commit | da9a5ef62283286c0fff70ddab65de6d514f9586 (patch) | |
tree | 42c0f93a6ba7d586b277d6cc7f8fe1b7cbb74923 /sql | |
parent | 643fbe4234a06e51746c8912223652a3b41fe133 (diff) | |
download | mariadb-git-da9a5ef62283286c0fff70ddab65de6d514f9586.tar.gz |
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.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_yacc.yy | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 09a0a4b2f12..0aa6308ab93 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -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 |