[t:3406], fix issue on main line

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@30362 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
Zardosht Kasheff 2013-04-17 00:02:05 -04:00 committed by Yoni Fogel
parent f055b22339
commit 2af613ff76

View file

@ -3639,6 +3639,8 @@ void ha_tokudb::set_main_dict_put_flags(
)
{
u_int32_t old_prelock_flags = (*put_flags)&(DB_PRELOCKED_FILE_READ);
uint curr_num_DBs = table->s->keys + test(hidden_primary_key);
bool in_hot_index = share->num_DBs > curr_num_DBs;
//
// optimization for "REPLACE INTO..." (and "INSERT IGNORE") command
// if the command is "REPLACE INTO" and the only table
@ -3661,13 +3663,13 @@ void ha_tokudb::set_main_dict_put_flags(
*put_flags = DB_YESOVERWRITE|old_prelock_flags;
}
else if (do_ignore_flag_optimization(thd,table,share->replace_into_fast) &&
is_replace_into(thd)
is_replace_into(thd) && !in_hot_index
)
{
*put_flags = DB_YESOVERWRITE|old_prelock_flags;
}
else if (do_ignore_flag_optimization(thd,table,share->replace_into_fast) &&
is_insert_ignore(thd) && no_overwrite_no_error_allowed
is_insert_ignore(thd) && no_overwrite_no_error_allowed && !in_hot_index
)
{
*put_flags = DB_NOOVERWRITE_NO_ERROR|old_prelock_flags;