12
12
You should have received a copy of the GNU General Public License
13
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
14
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
16
#include "heap_priv.h"
18
18
#include <string.h>
20
20
/* Read first record with the current key */
22
using namespace drizzled;
23
24
int heap_rlast(HP_INFO *info, unsigned char *record, int inx)
25
HP_SHARE *share= info->s;
26
HP_KEYDEF *keyinfo= share->keydef + inx;
28
26
info->lastinx= inx;
29
if (keyinfo->algorithm == HA_KEY_ALG_BTREE)
33
if ((pos = tree_search_edge(&keyinfo->rb_tree, info->parents,
34
&info->last_pos, offsetof(TREE_ELEMENT, right))))
36
memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos),
37
sizeof(unsigned char*));
38
info->current_ptr = pos;
39
hp_extract_record(share, record, pos);
40
info->update = HA_STATE_AKTIV;
44
my_errno = HA_ERR_END_OF_FILE;
51
28
info->current_ptr=0;
52
29
info->current_hash_ptr=0;