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