mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Manual merge
include/my_base.h: Auto merged innobase/include/row0mysql.h: Auto merged innobase/row/row0sel.c: Auto merged mysql-test/r/index_merge.result: Auto merged mysql-test/r/index_merge_innodb.result: Auto merged sql/ha_berkeley.cc: Auto merged sql/ha_berkeley.h: Auto merged sql/ha_heap.h: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_innodb.h: Auto merged sql/handler.h: Auto merged sql/sql_delete.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_select.h: Auto merged sql/sql_test.cc: Auto merged sql/sql_update.cc: Auto merged sql/opt_range.cc: Hand merged sql/opt_range.h: Hand merged
This commit is contained in:
@ -156,18 +156,11 @@ int mysql_update(THD *thd,
|
||||
}
|
||||
init_ftfuncs(thd, &thd->lex->select_lex, 1);
|
||||
/* Check if we are modifying a key that we are used to search with */
|
||||
|
||||
if (select && select->quick)
|
||||
{
|
||||
if (select->quick->get_type() != QUICK_SELECT_I::QS_TYPE_INDEX_MERGE)
|
||||
{
|
||||
used_index= select->quick->index;
|
||||
used_key_is_modified= (!select->quick->unique_key_range() &&
|
||||
check_if_key_used(table,used_index,fields));
|
||||
}
|
||||
else
|
||||
{
|
||||
used_key_is_modified= true;
|
||||
}
|
||||
used_key_is_modified= (!select->quick->unique_key_range() &&
|
||||
select->quick->check_if_keys_used(&fields));
|
||||
}
|
||||
else if ((used_index=table->file->key_used_on_scan) < MAX_KEY)
|
||||
used_key_is_modified=check_if_key_used(table, used_index, fields);
|
||||
@ -226,7 +219,7 @@ int mysql_update(THD *thd,
|
||||
if (open_cached_file(&tempfile, mysql_tmpdir,TEMP_PREFIX,
|
||||
DISK_BUFFER_SIZE, MYF(MY_WME)))
|
||||
goto err;
|
||||
|
||||
|
||||
/* If quick select is used, initialize it before retrieving rows. */
|
||||
if (select && select->quick && select->quick->reset())
|
||||
goto err;
|
||||
@ -286,6 +279,9 @@ int mysql_update(THD *thd,
|
||||
|
||||
if (handle_duplicates == DUP_IGNORE)
|
||||
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
|
||||
|
||||
if (select && select->quick && select->quick->reset())
|
||||
goto err;
|
||||
init_read_record(&info,thd,table,select,0,1);
|
||||
|
||||
updated= found= 0;
|
||||
@ -833,26 +829,7 @@ static bool safe_update_on_fly(JOIN_TAB *join_tab, List<Item> *fields)
|
||||
case JT_ALL:
|
||||
/* If range search on index */
|
||||
if (join_tab->quick)
|
||||
{
|
||||
if (join_tab->quick->get_type() != QUICK_SELECT_I::QS_TYPE_INDEX_MERGE)
|
||||
{
|
||||
return !check_if_key_used(table,join_tab->quick->index,*fields);
|
||||
}
|
||||
else
|
||||
{
|
||||
QUICK_INDEX_MERGE_SELECT *qsel_imerge=
|
||||
(QUICK_INDEX_MERGE_SELECT*)(join_tab->quick);
|
||||
List_iterator_fast<QUICK_RANGE_SELECT> it(qsel_imerge->quick_selects);
|
||||
QUICK_RANGE_SELECT *quick;
|
||||
while ((quick= it++))
|
||||
{
|
||||
if (check_if_key_used(table, quick->index, *fields))
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return !join_tab->quick->check_if_keys_used(fields);
|
||||
/* If scanning in clustered key */
|
||||
if ((table->file->table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX) &&
|
||||
table->primary_key < MAX_KEY)
|
||||
|
Reference in New Issue
Block a user