mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge mysql.com:/opt/local/work/mysql-4.1-root
into mysql.com:/opt/local/work/mysql-5.0-root
This commit is contained in:
@ -308,7 +308,6 @@ int mysql_update(THD *thd,
|
||||
SORT_FIELD *sortorder;
|
||||
ha_rows examined_rows;
|
||||
|
||||
used_index= MAX_KEY; // For call to init_read_record()
|
||||
table->sort.io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE),
|
||||
MYF(MY_FAE | MY_ZEROFILL));
|
||||
if (!(sortorder=make_unireg_sortorder(order, &length)) ||
|
||||
@ -339,10 +338,21 @@ 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;
|
||||
|
||||
/*
|
||||
When we get here, we have one of the following options:
|
||||
A. used_index == MAX_KEY
|
||||
This means we should use full table scan, and start it with
|
||||
init_read_record call
|
||||
B. used_index != MAX_KEY
|
||||
B.1 quick select is used, start the scan with init_read_record
|
||||
B.2 quick select is not used, this is full index scan (with LIMIT)
|
||||
Full index scan must be started with init_read_record_idx
|
||||
*/
|
||||
if (used_index == MAX_KEY || (select && select->quick))
|
||||
init_read_record(&info,thd,table,select,0,1);
|
||||
else
|
||||
|
Reference in New Issue
Block a user