1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.1

into mysql.com:/Users/mikron/wl1682
This commit is contained in:
mronstrom@mysql.com
2005-05-12 12:01:01 +02:00
30 changed files with 1737 additions and 513 deletions

View File

@@ -778,9 +778,10 @@ QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT()
{
DBUG_PRINT("info", ("Freeing separate handler %p (free=%d)", file,
free_file));
file->reset();
file->ha_reset();
file->external_lock(current_thd, F_UNLCK);
file->close();
delete file;
}
}
delete_dynamic(&ranges); /* ranges are allocated in alloc */
@@ -916,7 +917,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
{
DBUG_PRINT("info", ("Reusing handler %p", file));
if (file->extra(HA_EXTRA_KEYREAD) ||
file->extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) ||
file->ha_retrieve_all_pk() ||
init() || reset())
{
DBUG_RETURN(1);
@@ -944,7 +945,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
goto failure;
if (file->extra(HA_EXTRA_KEYREAD) ||
file->extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) ||
file->ha_retrieve_all_pk() ||
init() || reset())
{
file->external_lock(thd, F_UNLCK);
@@ -956,6 +957,8 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
DBUG_RETURN(0);
failure:
if (file)
delete file;
file= save_file;
DBUG_RETURN(1);
}
@@ -1563,7 +1566,8 @@ static int fill_used_fields_bitmap(PARAM *param)
param->fields_bitmap_size= (table->s->fields/8 + 1);
uchar *tmp;
uint pk;
if (!(tmp= (uchar*)alloc_root(param->mem_root,param->fields_bitmap_size)) ||
if (!(tmp= (uchar*)alloc_root(param->mem_root,
bytes_word_aligned(param->fields_bitmap_size))) ||
bitmap_init(&param->needed_fields, tmp, param->fields_bitmap_size*8,
FALSE))
return 1;
@@ -2318,7 +2322,7 @@ ROR_SCAN_INFO *make_ror_scan(const PARAM *param, int idx, SEL_ARG *sel_arg)
ror_scan->records= param->table->quick_rows[keynr];
if (!(bitmap_buf= (uchar*)alloc_root(param->mem_root,
param->fields_bitmap_size)))
bytes_word_aligned(param->fields_bitmap_size))))
DBUG_RETURN(NULL);
if (bitmap_init(&ror_scan->covered_fields, bitmap_buf,
@@ -2438,7 +2442,8 @@ ROR_INTERSECT_INFO* ror_intersect_init(const PARAM *param)
sizeof(ROR_INTERSECT_INFO))))
return NULL;
info->param= param;
if (!(buf= (uchar*)alloc_root(param->mem_root, param->fields_bitmap_size)))
if (!(buf= (uchar*)alloc_root(param->mem_root,
bytes_word_aligned(param->fields_bitmap_size))))
return NULL;
if (bitmap_init(&info->covered_fields, buf, param->fields_bitmap_size*8,
FALSE))
@@ -2995,7 +3000,8 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param,
/*I=set of all covering indexes */
ror_scan_mark= tree->ror_scans;
uchar buf[MAX_KEY/8+1];
uint32 int_buf[MAX_KEY/32+1];
uchar *buf= (uchar*)&int_buf;
MY_BITMAP covered_fields;
if (bitmap_init(&covered_fields, buf, nbits, FALSE))
DBUG_RETURN(0);
@@ -5643,7 +5649,7 @@ int QUICK_INDEX_MERGE_SELECT::read_keys_and_merge()
(This also creates a deficiency - it is possible that we will retrieve
parts of key that are not used by current query at all.)
*/
if (head->file->extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY))
if (head->file->ha_retrieve_all_pk())
DBUG_RETURN(1);
cur_quick_it.rewind();