~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_cache.cc

  • Committer: Monty Taylor
  • Date: 2010-01-02 05:11:55 UTC
  • mto: (1259.3.1 build)
  • mto: This revision was merged to the branch mainline in revision 1262.
  • Revision ID: mordred@inaugust.com-20100102051155-akdm8w5rr6xwzayu
pandora-build - proper detection of memcached.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
/*
17
17
  Functions for read record cacheing with myisam
38
38
#include <algorithm>
39
39
 
40
40
using namespace std;
41
 
using namespace drizzled;
42
 
 
43
 
 
44
 
int _mi_read_cache(internal::IO_CACHE *info, unsigned char *buff, internal::my_off_t pos, uint32_t length,
 
41
 
 
42
 
 
43
int _mi_read_cache(IO_CACHE *info, unsigned char *buff, my_off_t pos, uint32_t length,
45
44
                   int flag)
46
45
{
47
46
  uint32_t read_length,in_buff_length;
48
 
  internal::my_off_t offset;
 
47
  my_off_t offset;
49
48
  unsigned char *in_buff_pos;
50
49
 
51
50
  if (pos < info->pos_in_file)
52
51
  {
53
52
    read_length=length;
54
 
    if ((internal::my_off_t) read_length > (internal::my_off_t) (info->pos_in_file-pos))
 
53
    if ((my_off_t) read_length > (my_off_t) (info->pos_in_file-pos))
55
54
      read_length=(uint) (info->pos_in_file-pos);
56
55
    info->seek_not_done=1;
57
56
    if (my_pread(info->file,buff,read_length,pos,MYF(MY_NABP)))
62
61
    buff+=read_length;
63
62
  }
64
63
  if (pos >= info->pos_in_file &&
65
 
      (offset= (internal::my_off_t) (pos - info->pos_in_file)) <
66
 
      (internal::my_off_t) (info->read_end - info->request_pos))
 
64
      (offset= (my_off_t) (pos - info->pos_in_file)) <
 
65
      (my_off_t) (info->read_end - info->request_pos))
67
66
  {
68
67
    in_buff_pos=info->request_pos+(uint) offset;
69
68
    in_buff_length= min(length, (uint32_t) (info->read_end-in_buff_pos));