33 int myrg_rrnd(
MYRG_INFO *info,uchar *
buf,ulonglong filepos)
37 DBUG_ENTER(
"myrg_rrnd");
38 DBUG_PRINT(
"info",(
"offset: %lu", (ulong) filepos));
40 if (filepos == HA_OFFSET_ERROR)
42 if (!info->current_table)
44 if (info->open_tables == info->end_table)
46 DBUG_RETURN(my_errno=HA_ERR_END_OF_FILE);
48 isam_info=(info->current_table=info->open_tables)->
table;
49 if (info->cache_in_use)
50 mi_extra(isam_info,HA_EXTRA_CACHE,(uchar*) &info->cache_size);
51 filepos=isam_info->s->pack.header_length;
52 isam_info->lastinx= (uint) -1;
56 isam_info=info->current_table->table;
57 filepos= isam_info->nextpos;
62 isam_info->update&= HA_STATE_CHANGED;
63 if ((error=(*isam_info->s->read_rnd)(isam_info,(uchar*) buf,
64 (my_off_t) filepos,1)) !=
67 if (info->cache_in_use)
68 mi_extra(info->current_table->table, HA_EXTRA_NO_CACHE,
69 (uchar*) &info->cache_size);
70 if (info->current_table+1 == info->end_table)
71 DBUG_RETURN(HA_ERR_END_OF_FILE);
72 info->current_table++;
73 info->last_used_table=info->current_table;
74 if (info->cache_in_use)
75 mi_extra(info->current_table->table, HA_EXTRA_CACHE,
76 (uchar*) &info->cache_size);
77 info->current_table->file_offset=
78 info->current_table[-1].file_offset+
79 info->current_table[-1].table->state->data_file_length;
81 isam_info=info->current_table->table;
82 filepos=isam_info->s->pack.header_length;
83 isam_info->lastinx= (uint) -1;
86 info->current_table=find_table(info->open_tables,
87 info->end_table-1,filepos);
88 isam_info=info->current_table->table;
89 isam_info->update&= HA_STATE_CHANGED;
90 DBUG_RETURN((*isam_info->s->read_rnd)
91 (isam_info, (uchar*) buf,
92 (my_off_t) (filepos - info->current_table->file_offset),
103 DBUG_ENTER(
"find_table");
107 mid=start+((uint) (end-start)+1)/2;
108 if (mid->file_offset > pos)
113 DBUG_PRINT(
"info",(
"offset: %lu, table: %s",
114 (ulong) pos, start->table->filename));