1
/* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
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 */
16
/* Read through all rows sequntially */
18
#include "maria_def.h"
20
int maria_scan_init(register MARIA_HA *info)
22
DBUG_ENTER("maria_scan_init");
24
info->cur_row.nextpos= info->s->pack.header_length; /* Read first record */
25
info->lastinx= -1; /* Can't forward or backward */
26
if (info->opt_flag & WRITE_CACHE_USED && flush_io_cache(&info->rec_cache))
27
DBUG_RETURN(my_errno);
29
if ((*info->s->scan_init)(info))
30
DBUG_RETURN(my_errno);
35
Read a row based on position.
44
HA_ERR_END_OF_FILE End of file
45
HA_ERR_RECORD_DELETED Record was deleted (can only happen for static rec)
49
int maria_scan(MARIA_HA *info, uchar *record)
51
DBUG_ENTER("maria_scan");
52
/* Init all but update-flag */
53
info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
54
DBUG_RETURN((*info->s->scan)(info, record, info->cur_row.nextpos, 1));
58
void maria_scan_end(MARIA_HA *info)
60
(*info->s->scan_end)(info);
64
int _ma_def_scan_remember_pos(MARIA_HA *info, MARIA_RECORD_POS *lastpos)
66
*lastpos= info->cur_row.lastpos;
71
void _ma_def_scan_restore_pos(MARIA_HA *info, MARIA_RECORD_POS lastpos)
73
info->cur_row.nextpos= lastpos;