summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-02-01 19:59:24 +0100
committerSergei Golubchik <serg@mariadb.org>2017-02-13 18:12:05 +0100
commit4dd7e11332cab9eb07551062f3ba0f696d9602e3 (patch)
treef2594272ca663e744d96be05c5aea9ed62060e76
parentbf8f70a47c0fb606b52ecea94dd450b22cd02098 (diff)
downloadmariadb-git-4dd7e11332cab9eb07551062f3ba0f696d9602e3.tar.gz
cleanup: mark_columns_used_by_index_no_reset in handler::get_auto_increment
use table->mark_columns_used_by_index, don't copy it
-rw-r--r--sql/handler.cc8
-rw-r--r--sql/table.cc12
-rw-r--r--sql/table.h8
3 files changed, 13 insertions, 15 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 2aa905f70f6..d32b13ef5fb 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -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;
}
diff --git a/sql/table.cc b/sql/table.cc
index 8290d3d9ea5..16396b70d6b 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -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;
}
diff --git a/sql/table.h b/sql/table.h
index 6c29a9767fb..845c94b11c4 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1307,11 +1307,11 @@ public:
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);