List:Internals« Previous MessageNext Message »
From:Scara Maccai Date:July 2 2008 2:58pm
Subject:Re: position and rnd_pos
View as plain text  
Sergei Golubchik wrote:
> Here's the one with filesort (I used MyISAM below):
>
> create table t1 (a varchar(200));
> insert t1 values (rand());
> insert t1 select rand() from t1;
> insert t1 select rand() from t1;
> insert t1 select rand() from t1;
> insert t1 select rand() from t1;
> insert t1 select rand() from t1;
> select * from t1 order by a limit 5;
>
> The last one has tripped over my breakpoint in ha_myisam::position().
>
>   

Ok, thank you
> MySQL doesn't ask you to allocate anything, so MySQL won't free it
> either. You're expected to put the "position" in this->ref. MySQL will
> copy it out from there. Later it'll use this copy as an argument for
> rnd_pos(). What is it that you need to be released ?
>   
I didn't see

if (!(ref= (byte*) alloc_root(&table->mem_root, ALIGN_SIZE(ref_length)*2)))

in handler.cc


So I thought that my_store_ptr was allocating memory (since ref is a 
byte*), hence I thought that I needed to free it.




Thank you





Thread
position and rnd_posScara Maccai25 Jun
  • re: position and rnd_posMichael Widenius25 Jun
  • Re: position and rnd_posSergei Golubchik25 Jun
    • Re: position and rnd_posScara Maccai25 Jun
      • Re: position and rnd_posSergei Golubchik30 Jun
        • Re: position and rnd_posScara Maccai2 Jul
    • Re: position and rnd_posMark Callaghan26 Jun