summaryrefslogtreecommitdiff
path: root/sql/sql_statistics.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_statistics.cc')
-rw-r--r--sql/sql_statistics.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc
index 7b600bd45c4..72a55bfa86b 100644
--- a/sql/sql_statistics.cc
+++ b/sql/sql_statistics.cc
@@ -1023,9 +1023,8 @@ public:
{
char buff[MAX_FIELD_WIDTH];
String val(buff, sizeof(buff), &my_charset_bin);
- my_bitmap_map *old_map;
- old_map= dbug_tmp_use_all_columns(stat_table, stat_table->read_set);
+ MY_BITMAP *old_map= dbug_tmp_use_all_columns(stat_table, &stat_table->read_set);
for (uint i= COLUMN_STAT_MIN_VALUE; i <= COLUMN_STAT_HISTOGRAM; i++)
{
Field *stat_field= stat_table->field[i];
@@ -1087,7 +1086,7 @@ public:
}
}
}
- dbug_tmp_restore_column_map(stat_table->read_set, old_map);
+ dbug_tmp_restore_column_map(&stat_table->read_set, old_map);
}
@@ -2126,6 +2125,10 @@ int alloc_statistics_for_table(THD* thd, TABLE *table)
ulonglong *idx_avg_frequency= (ulonglong*) alloc_root(&table->mem_root,
sizeof(ulonglong) * key_parts);
+ if (table->file->ha_rnd_init(TRUE))
+ DBUG_RETURN(1);
+ table->file->ha_rnd_end();
+
uint columns= 0;
for (field_ptr= table->field; *field_ptr; field_ptr++)
{