@@ -584,7 +584,7 @@ static int rr_unpack_from_buffer(READ_RECORD *info)
584584
585585static int init_rr_cache (THD *thd, READ_RECORD *info)
586586{
587- uint rec_cache_size;
587+ uint rec_cache_size, cache_records ;
588588 DBUG_ENTER (" init_rr_cache" );
589589
590590 info->struct_length = 3 +MAX_REFLENGTH;
@@ -593,22 +593,22 @@ static int init_rr_cache(THD *thd, READ_RECORD *info)
593593 info->reclength = ALIGN_SIZE (info->struct_length );
594594
595595 info->error_offset = info->table ->s ->reclength ;
596- info-> cache_records = ( thd->variables .read_rnd_buff_size /
597- (info->reclength + info->struct_length ) );
598- rec_cache_size= info-> cache_records * info->reclength ;
599- info->rec_cache_size = info-> cache_records * info->ref_length ;
596+ cache_records= thd->variables .read_rnd_buff_size /
597+ (info->reclength + info->struct_length );
598+ rec_cache_size= cache_records * info->reclength ;
599+ info->rec_cache_size = cache_records * info->ref_length ;
600600
601601 // We have to allocate one more byte to use uint3korr (see comments for it)
602- if (info-> cache_records <= 2 ||
603- !(info->cache =(uchar*) my_malloc_lock (rec_cache_size+info-> cache_records *
604- info->struct_length + 1 ,
605- MYF (MY_THREAD_SPECIFIC))))
602+ if (cache_records <= 2 ||
603+ !(info->cache = (uchar*) my_malloc_lock (rec_cache_size + cache_records *
604+ info->struct_length + 1 ,
605+ MYF (MY_THREAD_SPECIFIC))))
606606 DBUG_RETURN (1 );
607607#ifdef HAVE_valgrind
608608 // Avoid warnings in qsort
609- bzero (info->cache ,rec_cache_size+info-> cache_records * info->struct_length + 1 );
609+ bzero (info->cache , rec_cache_size + cache_records * info->struct_length + 1 );
610610#endif
611- DBUG_PRINT (" info" ,(" Allocated buffert for %d records" ,info-> cache_records ));
611+ DBUG_PRINT (" info" , (" Allocated buffer for %d records" , cache_records));
612612 info->read_positions =info->cache +rec_cache_size;
613613 info->cache_pos =info->cache_end =info->cache ;
614614 DBUG_RETURN (0 );
0 commit comments