summaryrefslogtreecommitdiff
path: root/myisammrg
diff options
context:
space:
mode:
Diffstat (limited to 'myisammrg')
-rw-r--r--myisammrg/myrg_extra.c12
-rw-r--r--myisammrg/myrg_rrnd.c8
2 files changed, 15 insertions, 5 deletions
diff --git a/myisammrg/myrg_extra.c b/myisammrg/myrg_extra.c
index 5434d30a50e..ad17b0f82f2 100644
--- a/myisammrg/myrg_extra.c
+++ b/myisammrg/myrg_extra.c
@@ -22,7 +22,8 @@
#include "myrg_def.h"
-int myrg_extra(MYRG_INFO *info,enum ha_extra_function function)
+int myrg_extra(MYRG_INFO *info,enum ha_extra_function function,
+ void *extra_arg)
{
int error,save_error=0;
MYRG_TABLE *file;
@@ -30,7 +31,11 @@ int myrg_extra(MYRG_INFO *info,enum ha_extra_function function)
DBUG_PRINT("info",("function: %d",(ulong) function));
if (function == HA_EXTRA_CACHE)
+ {
info->cache_in_use=1;
+ info->cache_size= (extra_arg ? *(long*) extra_arg :
+ my_default_record_cache_size);
+ }
else
{
if (function == HA_EXTRA_NO_CACHE || function == HA_EXTRA_RESET)
@@ -41,12 +46,15 @@ int myrg_extra(MYRG_INFO *info,enum ha_extra_function function)
info->last_used_table=info->open_tables;
}
for (file=info->open_tables ; file != info->end_table ; file++)
- if ((error=mi_extra(file->table,function)))
+ {
+ if ((error=mi_extra(file->table, function, extra_arg)))
save_error=error;
+ }
}
DBUG_RETURN(save_error);
}
+
void myrg_extrafunc(MYRG_INFO *info, invalidator_by_filename inv)
{
MYRG_TABLE *file;
diff --git a/myisammrg/myrg_rrnd.c b/myisammrg/myrg_rrnd.c
index 3e7002c8679..d623ea8ea9c 100644
--- a/myisammrg/myrg_rrnd.c
+++ b/myisammrg/myrg_rrnd.c
@@ -48,7 +48,7 @@ int myrg_rrnd(MYRG_INFO *info,byte *buf,ulonglong filepos)
}
isam_info=(info->current_table=info->open_tables)->table;
if (info->cache_in_use)
- mi_extra(isam_info,HA_EXTRA_CACHE);
+ mi_extra(isam_info,HA_EXTRA_CACHE,(byte*) &info->cache_size);
filepos=isam_info->s->pack.header_length;
isam_info->lastinx= (uint) -1; /* Can't forward or backward */
}
@@ -66,13 +66,15 @@ int myrg_rrnd(MYRG_INFO *info,byte *buf,ulonglong filepos)
HA_ERR_END_OF_FILE)
DBUG_RETURN(error);
if (info->cache_in_use)
- mi_extra(info->current_table->table,HA_EXTRA_NO_CACHE);
+ mi_extra(info->current_table->table, HA_EXTRA_NO_CACHE,
+ (byte*) &info->cache_size);
if (info->current_table+1 == info->end_table)
DBUG_RETURN(HA_ERR_END_OF_FILE);
info->current_table++;
info->last_used_table=info->current_table;
if (info->cache_in_use)
- mi_extra(info->current_table->table,HA_EXTRA_CACHE);
+ mi_extra(info->current_table->table, HA_EXTRA_CACHE,
+ (byte*) &info->cache_size);
info->current_table->file_offset=
info->current_table[-1].file_offset+
info->current_table[-1].table->state->data_file_length;