diff options
author | unknown <mats@mysql.com> | 2005-02-18 13:50:19 +0100 |
---|---|---|
committer | unknown <mats@mysql.com> | 2005-02-18 13:50:19 +0100 |
commit | 41a329f9a190c05767332b816496c52ee40b3ab9 (patch) | |
tree | 341e4ffb07fb4c0865ca30da763750d3d2905662 | |
parent | fd4b5c8ddcb29f22343f4e84fbf3ac02fe8aab50 (diff) | |
parent | 95dec435c2c2b0d2dff54adb5d46b1d766efa3b7 (diff) | |
download | mariadb-git-41a329f9a190c05767332b816496c52ee40b3ab9.tar.gz |
Merge mysql.com:/home/bkroot/mysql-4.0
into mysql.com:/home/bk/b7879-mysql-4.0
sql/sql_update.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
-rw-r--r-- | sql/sql_update.cc | 5 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index b1b30a29639..b2b10a9b59a 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -473,7 +473,10 @@ int mysql_multi_update_lock(THD *thd, else { DBUG_PRINT("info",("setting table `%s` for read-only", tl->alias)); - tl->lock_type= TL_READ; + // If we are using the binary log, we need TL_READ_NO_INSERT to get + // correct order of statements. Otherwise, we use a TL_READ lock to + // improve performance. + tl->lock_type= using_update_log ? TL_READ_NO_INSERT : TL_READ; tl->updating= 0; wants= SELECT_ACL; } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 6d0237f5615..39b57061507 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -822,7 +822,7 @@ create_select: SELECT_SYM { LEX *lex=Lex; - lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ; + lex->lock_option= using_update_log ? TL_READ_NO_INSERT : TL_READ; if (lex->sql_command == SQLCOM_INSERT) lex->sql_command= SQLCOM_INSERT_SELECT; else if (lex->sql_command == SQLCOM_REPLACE) @@ -1532,7 +1532,7 @@ select_part2: { LEX *lex=Lex; lex->lock_option=TL_READ; - mysql_init_select(lex); + mysql_init_select(lex); } select_options select_item_list select_into select_lock_type; |