List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:June 25 2008 12:47pm
Subject:re: position and rnd_pos
View as plain text  

>>>>> "Scara" == Scara Maccai <m_lists@stripped> writes:

Scara> I'm writing my own custom engine.
Scara> In the docs I read: 

Scara> "The position() method is called after every call to rnd_next() if the data
> needs to be reordered" 

Scara> But I can't find a way to trigger the "position" call in my custom engine. 

Scara> Plus: 

Scara> "void ha_foo::position(const byte *record) 
Scara> The contents of *record are up to you whatever value you provide will be 
Scara> returned in a later call to retrieve the row. " 

Scara> But in myisam: 

Scara> void ha_myisam::position(const uchar *record) 
Scara> { 
Scara> my_off_t row_position= mi_position(file); 
Scara> my_store_ptr(ref, ref_length, row_position); 
Scara> } 

Scara> the "record" par is not even used... 

Scara> Can somebody explain? 

The record is only needed if your engine needs some parts of the
current record to generate a reference key to the current row. For
example if you can only refer to a row with a primary key.

MyISAM maintains a direct pointer to the current row and this is what
it returns to the handler level.

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