Commit 4dd7e113 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: mark_columns_used_by_index_no_reset in handler::get_auto_increment

use table->mark_columns_used_by_index, don't copy it
parent bf8f70a4
......@@ -3222,11 +3222,9 @@ void handler::get_auto_increment(ulonglong offset, ulonglong increment,
{
ulonglong nr;
int error;
MY_BITMAP *old_read_set;
(void) extra(HA_EXTRA_KEYREAD);
table->mark_columns_used_by_index_no_reset(table->s->next_number_index,
table->read_set);
column_bitmaps_signal();
old_read_set= table->mark_columns_used_by_index(table->s->next_number_index);
if (ha_index_init(table->s->next_number_index, 1))
{
......@@ -3278,7 +3276,7 @@ void handler::get_auto_increment(ulonglong offset, ulonglong increment,
nr= ((ulonglong) table->next_number_field->
val_int_offset(table->s->rec_buff_length)+1);
ha_index_end();
(void) extra(HA_EXTRA_NO_KEYREAD);
table->restore_column_maps_after_mark_index(old_read_set);
*first_value= nr;
return;
}
......
......@@ -6080,16 +6080,17 @@ void TABLE::prepare_for_position()
or TABLE::restore_column_maps_after_mark_index()
*/
void TABLE::mark_columns_used_by_index_in_bitmap(uint index, MY_BITMAP *bitmap)
MY_BITMAP *TABLE::mark_columns_used_by_index_in_bitmap(uint index,
MY_BITMAP *bitmap)
{
MY_BITMAP *backup= read_set;
DBUG_ENTER("TABLE::mark_columns_used_by_index_in_bitmap");
if (!no_keyread)
file->ha_start_keyread();
bitmap_clear_all(bitmap);
mark_columns_used_by_index_no_reset(index, bitmap);
column_bitmaps_set(bitmap);
DBUG_VOID_RETURN;
DBUG_RETURN(backup);
}
......@@ -6125,12 +6126,11 @@ void TABLE::add_read_columns_used_by_index(uint index)
when calling mark_columns_used_by_index
*/
void TABLE::restore_column_maps_after_mark_index()
void TABLE::restore_column_maps_after_mark_index(MY_BITMAP *backup)
{
DBUG_ENTER("TABLE::restore_column_maps_after_mark_index");
file->ha_end_keyread();
default_column_bitmaps();
read_set= backup;
file->column_bitmaps_signal();
DBUG_VOID_RETURN;
}
......
......@@ -1307,11 +1307,11 @@ struct TABLE
void clear_column_bitmaps(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_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); }
MY_BITMAP *mark_columns_used_by_index_in_bitmap(uint index, MY_BITMAP *map);
MY_BITMAP *mark_columns_used_by_index(uint index)
{ return mark_columns_used_by_index_in_bitmap(index, &tmp_set); }
void add_read_columns_used_by_index(uint index);
void restore_column_maps_after_mark_index();
void restore_column_maps_after_mark_index(MY_BITMAP *backup);
void mark_auto_increment_column(void);
void mark_columns_needed_for_update(void);
void mark_columns_needed_for_delete(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment