~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/mf_iocache.cc

  • Committer: Monty Taylor
  • Date: 2008-10-16 06:32:30 UTC
  • mto: (511.1.5 codestyle)
  • mto: This revision was merged to the branch mainline in revision 521.
  • Revision ID: monty@inaugust.com-20081016063230-4brxsra0qsmsg84q
Added -Wunused-macros.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
  only be created if a write exeeds the file buffer or if one calls
32
32
  flush_io_cache().  
33
33
*/
34
 
 
35
 
#include "mysql_priv.h"
36
 
#ifdef HAVE_REPLICATION
 
34
#include <drizzled/server_includes.h>
37
35
 
38
36
extern "C" {
39
37
 
45
43
  @retval
46
44
    0   if record read
47
45
*/
48
 
 
49
 
 
50
 
int _my_b_net_read(register IO_CACHE *info, uchar *Buffer,
 
46
int _my_b_net_read(register IO_CACHE *info, unsigned char *Buffer,
51
47
                   size_t Count __attribute__((unused)))
52
48
{
53
49
  ulong read_length;
54
50
  NET *net= &(current_thd)->net;
55
 
  DBUG_ENTER("_my_b_net_read");
56
51
 
57
52
  if (!info->end_of_file)
58
 
    DBUG_RETURN(1);     /* because my_b_get (no _) takes 1 byte at a time */
 
53
    return(1);  /* because my_b_get (no _) takes 1 byte at a time */
59
54
  read_length=my_net_read(net);
60
55
  if (read_length == packet_error)
61
56
  {
62
57
    info->error= -1;
63
 
    DBUG_RETURN(1);
 
58
    return(1);
64
59
  }
65
60
  if (read_length == 0)
66
61
  {
67
62
    info->end_of_file= 0;                       /* End of file from client */
68
 
    DBUG_RETURN(1);
 
63
    return(1);
69
64
  }
70
65
  /* to set up stuff for my_b_get (no _) */
71
 
  info->read_end = (info->read_pos = (uchar*) net->read_pos) + read_length;
 
66
  info->read_end = (info->read_pos = (unsigned char*) net->read_pos) + read_length;
72
67
  Buffer[0] = info->read_pos[0];                /* length is always 1 */
73
68
 
74
69
  /*
81
76
 
82
77
  info->read_pos++;
83
78
 
84
 
  DBUG_RETURN(0);
 
79
  return(0);
85
80
}
86
81
 
87
82
} /* extern "C" */
88
 
#endif /* HAVE_REPLICATION */
89
 
 
90