1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

cleanup: mark_columns_used_by_index_no_reset in opt_range.cc

use table->mark_columns_used_by_index, don't copy it
This commit is contained in:
Sergei Golubchik
2017-02-01 17:20:35 +01:00
parent 0254f1a6e0
commit bf8f70a47c
3 changed files with 10 additions and 15 deletions

View File

@ -1488,7 +1488,6 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler,
{ {
DBUG_RETURN(1); DBUG_RETURN(1);
} }
head->column_bitmaps_set(&column_bitmap, &column_bitmap, &column_bitmap);
goto end; goto end;
} }
@ -1513,8 +1512,6 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler,
goto failure; /* purecov: inspected */ goto failure; /* purecov: inspected */
} }
head->column_bitmaps_set(&column_bitmap, &column_bitmap, &column_bitmap);
if (file->ha_external_lock(thd, F_RDLCK)) if (file->ha_external_lock(thd, F_RDLCK))
goto failure; goto failure;
@ -1528,7 +1525,6 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler,
last_rowid= file->ref; last_rowid= file->ref;
end: end:
DBUG_ASSERT(head->read_set == &column_bitmap);
/* /*
We are only going to read key fields and call position() on 'file' We are only going to read key fields and call position() on 'file'
The following sets head->read_set (== column_bitmap) to only use this The following sets head->read_set (== column_bitmap) to only use this
@ -1536,11 +1532,9 @@ end:
*/ */
org_file= head->file; org_file= head->file;
head->file= file; head->file= file;
head->mark_columns_used_by_index_no_reset(index, &column_bitmap);
if (!head->no_keyread)
head->file->ha_start_keyread();
head->column_bitmaps_set_no_signal(&column_bitmap, &column_bitmap, &column_bitmap);
head->mark_columns_used_by_index_in_bitmap(index, &column_bitmap);
head->prepare_for_position(); head->prepare_for_position();
head->file= org_file; head->file= org_file;

View File

@ -6080,12 +6080,12 @@ void TABLE::prepare_for_position()
or TABLE::restore_column_maps_after_mark_index() or TABLE::restore_column_maps_after_mark_index()
*/ */
void TABLE::mark_columns_used_by_index(uint index) void TABLE::mark_columns_used_by_index_in_bitmap(uint index, MY_BITMAP *bitmap)
{ {
MY_BITMAP *bitmap= &tmp_set; DBUG_ENTER("TABLE::mark_columns_used_by_index_in_bitmap");
DBUG_ENTER("TABLE::mark_columns_used_by_index");
file->ha_start_keyread(); if (!no_keyread)
file->ha_start_keyread();
bitmap_clear_all(bitmap); bitmap_clear_all(bitmap);
mark_columns_used_by_index_no_reset(index, bitmap); mark_columns_used_by_index_no_reset(index, bitmap);
column_bitmaps_set(bitmap); column_bitmaps_set(bitmap);
@ -6140,8 +6140,7 @@ void TABLE::restore_column_maps_after_mark_index()
mark columns used by key, but don't reset other fields mark columns used by key, but don't reset other fields
*/ */
void TABLE::mark_columns_used_by_index_no_reset(uint index, void TABLE::mark_columns_used_by_index_no_reset(uint index, MY_BITMAP *bitmap)
MY_BITMAP *bitmap)
{ {
KEY_PART_INFO *key_part= key_info[index].key_part; KEY_PART_INFO *key_part= key_info[index].key_part;
KEY_PART_INFO *key_part_end= (key_part + KEY_PART_INFO *key_part_end= (key_part +

View File

@ -1307,7 +1307,9 @@ public:
void clear_column_bitmaps(void); void clear_column_bitmaps(void);
void prepare_for_position(void); void prepare_for_position(void);
void mark_columns_used_by_index_no_reset(uint index, MY_BITMAP *map); void mark_columns_used_by_index_no_reset(uint index, MY_BITMAP *map);
void mark_columns_used_by_index(uint index); void mark_columns_used_by_index_in_bitmap(uint index, MY_BITMAP *map);
void mark_columns_used_by_index(uint index)
{ mark_columns_used_by_index_in_bitmap(index, &tmp_set); }
void add_read_columns_used_by_index(uint index); void add_read_columns_used_by_index(uint index);
void restore_column_maps_after_mark_index(); void restore_column_maps_after_mark_index();
void mark_auto_increment_column(void); void mark_auto_increment_column(void);