From: Date: May 28 2007 2:43pm Subject: bk commit into 5.0 tree (gkodinov:1.2504) BUG#26162 List-Archive: http://lists.mysql.com/commits/27462 X-Bug: 26162 Message-Id: <20070528124359.4E8F510C5A68@macbook.gmz> Below is the list of changes that have just been committed into a local 5.0 repository of kgeorge. When kgeorge does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2007-05-28 15:43:22+03:00, gkodinov@stripped +4 -0 Bug #26162: The value of "low-priority-updates" option and the LOW PRIORITY prefix was taken into account at parse time. This caused triggers (among others) to ignore this flag (if supplied for the DML statement). Moved reading of the LOW PRIORITY flag at run time. Fixed an incosistency when handling SET GLOBAL LOW_PRIORITY_UPDATES : now it is in effect for delayed INSERTs. include/thr_lock.h@stripped, 2007-05-28 15:43:04+03:00, gkodinov@stripped +5 -0 Bug #26162: moved reading of the LOW PRIORITY flag at run time sql/set_var.cc@stripped, 2007-05-28 15:43:05+03:00, gkodinov@stripped +5 -1 Bug #26162: fixed the handling of the "low-priority-updates" option sql/sql_base.cc@stripped, 2007-05-28 15:43:07+03:00, gkodinov@stripped +7 -0 Bug #26162: moved reading of the LOW PRIORITY flag at run time sql/sql_yacc.yy@stripped, 2007-05-28 15:43:08+03:00, gkodinov@stripped +6 -6 Bug #26162: moved reading of the LOW PRIORITY flag at run time # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: gkodinov # Host: macbook.gmz # Root: /Users/kgeorge/mysql/work/B26162-5.0-opt --- 1.19/include/thr_lock.h 2006-12-30 01:44:21 +02:00 +++ 1.20/include/thr_lock.h 2007-05-28 15:43:04 +03:00 @@ -54,6 +54,11 @@ enum thr_lock_type { TL_IGNORE=-1, TL_WRITE_CONCURRENT_INSERT, /* Write used by INSERT DELAYED. Allows READ locks */ TL_WRITE_DELAYED, + /* + parser only! Late bound low_priority flag. + At open_tables() becomes thd->update_lock_default. + */ + TL_WRITE_DEFAULT, /* WRITE lock that has lower priority than TL_READ */ TL_WRITE_LOW_PRIORITY, /* Normal WRITE lock */ --- 1.381/sql/sql_base.cc 2007-05-28 01:05:33 +03:00 +++ 1.382/sql/sql_base.cc 2007-05-28 15:43:07 +03:00 @@ -1505,6 +1505,7 @@ TABLE *open_table(THD *thd, TABLE_LIST * HASH_SEARCH_STATE state; DBUG_ENTER("open_table"); + DBUG_ASSERT (table_list->lock_type != TL_WRITE_DEFAULT); /* find a unused table in the open table cache */ if (refresh) *refresh=0; @@ -2667,6 +2668,12 @@ int open_tables(THD *thd, TABLE_LIST **s for (tables= *start; tables ;tables= tables->next_global) { safe_to_ignore_table= FALSE; // 'FALSE', as per coding style + + if (tables->lock_type == TL_WRITE_DEFAULT) + { + tables->lock_type= thd->update_lock_default; + DBUG_ASSERT (tables->lock_type >= TL_WRITE_ALLOW_WRITE); + } /* Ignore placeholders for derived tables. After derived tables processing, link to created temporary table will be put here. --- 1.519/sql/sql_yacc.yy 2007-05-15 12:56:05 +03:00 +++ 1.520/sql/sql_yacc.yy 2007-05-28 15:43:08 +03:00 @@ -6561,7 +6561,7 @@ insert_lock_option: insert visible only after the table unlocking but everyone can read table. */ - $$= (Lex->sphead ? TL_WRITE :TL_WRITE_CONCURRENT_INSERT); + $$= (Lex->sphead ? TL_WRITE_DEFAULT : TL_WRITE_CONCURRENT_INSERT); #else $$= TL_WRITE_CONCURRENT_INSERT; #endif @@ -6739,7 +6739,7 @@ insert_update_elem: }; opt_low_priority: - /* empty */ { $$= YYTHD->update_lock_default; } + /* empty */ { $$= TL_WRITE_DEFAULT; } | LOW_PRIORITY { $$= TL_WRITE_LOW_PRIORITY; }; /* Delete rows from a table */ @@ -6750,7 +6750,7 @@ delete: LEX *lex= Lex; lex->sql_command= SQLCOM_DELETE; mysql_init_select(lex); - lex->lock_option= lex->thd->update_lock_default; + lex->lock_option= TL_WRITE_DEFAULT; lex->ignore= 0; lex->select_lex.init_order(); } @@ -7415,7 +7415,7 @@ opt_local: | LOCAL_SYM { $$=1;}; load_data_lock: - /* empty */ { $$= YYTHD->update_lock_default; } + /* empty */ { $$= TL_WRITE_DEFAULT; } | CONCURRENT { #ifdef HAVE_QUERY_CACHE @@ -7423,7 +7423,7 @@ load_data_lock: Ignore this option in SP to avoid problem with query cache */ if (Lex->sphead != 0) - $$= YYTHD->update_lock_default; + $$= TL_WRITE_DEFAULT; else #endif $$= TL_WRITE_CONCURRENT_INSERT; @@ -8736,7 +8736,7 @@ table_lock: lock_option: READ_SYM { $$=TL_READ_NO_INSERT; } - | WRITE_SYM { $$=YYTHD->update_lock_default; } + | WRITE_SYM { $$=TL_WRITE_DEFAULT; } | LOW_PRIORITY WRITE_SYM { $$=TL_WRITE_LOW_PRIORITY; } | READ_SYM LOCAL_SYM { $$= TL_READ; } ; --- 1.185/sql/set_var.cc 2007-05-15 12:56:04 +03:00 +++ 1.186/sql/set_var.cc 2007-05-28 15:43:05 +03:00 @@ -1226,7 +1226,11 @@ static void sys_default_ftb_syntax(THD * static void fix_low_priority_updates(THD *thd, enum_var_type type) { - if (type != OPT_GLOBAL) + if (type == OPT_GLOBAL) + thr_upgraded_concurrent_insert_lock= + (global_system_variables.low_priority_updates ? + TL_WRITE_LOW_PRIORITY : TL_WRITE); + else thd->update_lock_default= (thd->variables.low_priority_updates ? TL_WRITE_LOW_PRIORITY : TL_WRITE); }