summaryrefslogtreecommitdiff
path: root/storage/myisammrg/myrg_range.c
diff options
context:
space:
mode:
Diffstat (limited to 'storage/myisammrg/myrg_range.c')
-rw-r--r--storage/myisammrg/myrg_range.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/storage/myisammrg/myrg_range.c b/storage/myisammrg/myrg_range.c
index 893bda20833..da5e2c38d68 100644
--- a/storage/myisammrg/myrg_range.c
+++ b/storage/myisammrg/myrg_range.c
@@ -17,14 +17,21 @@
#include "myrg_def.h"
ha_rows myrg_records_in_range(MYRG_INFO *info, int inx,
- key_range *min_key, key_range *max_key)
+ const key_range *min_key,
+ const key_range *max_key,
+ page_range *pages)
{
ha_rows records=0, res;
MYRG_TABLE *table;
+ page_range ignore_pages;
+
+ /* Don't calculate pages of more than one active partition */
+ if (info->open_tables +1 != info->end_table)
+ pages= &ignore_pages;
for (table=info->open_tables ; table != info->end_table ; table++)
{
- res= mi_records_in_range(table->table, inx, min_key, max_key);
+ res= mi_records_in_range(table->table, inx, min_key, max_key, pages);
if (res == HA_POS_ERROR)
return HA_POS_ERROR;
if (records > HA_POS_ERROR - res)