summaryrefslogtreecommitdiff
path: root/sql/mf_iocache.cc
diff options
context:
space:
mode:
authormonty@bitch.mysql.fi <>2001-11-28 02:55:52 +0200
committermonty@bitch.mysql.fi <>2001-11-28 02:55:52 +0200
commitd0ccff50907e7b04f0d14ad95f359dc23e6dc294 (patch)
tree40e5d73c964ca6aeb5e0e7d4294e70216edaa397 /sql/mf_iocache.cc
parentd3288575de18b38179961a8acf93ba883a90e652 (diff)
downloadmariadb-git-d0ccff50907e7b04f0d14ad95f359dc23e6dc294.tar.gz
New improved IO_CACHE
Diffstat (limited to 'sql/mf_iocache.cc')
-rw-r--r--sql/mf_iocache.cc26
1 files changed, 16 insertions, 10 deletions
diff --git a/sql/mf_iocache.cc b/sql/mf_iocache.cc
index 55e953687a3..2a7b25eab2f 100644
--- a/sql/mf_iocache.cc
+++ b/sql/mf_iocache.cc
@@ -52,26 +52,32 @@ int _my_b_net_read(register IO_CACHE *info, byte *Buffer,
{
int read_length;
NET *net= &(current_thd)->net;
+ DBUG_ENTER("_my_b_net_read");
- if (info->end_of_file)
- return 1; /* because my_b_get (no _) takes 1 byte at a time */
+ if (!info->end_of_file)
+ DBUG_RETURN(1); /* because my_b_get (no _) takes 1 byte at a time */
read_length=my_net_read(net);
if (read_length == (int) packet_error)
{
info->error= -1;
- return 1;
+ DBUG_RETURN(1);
}
if (read_length == 0)
{
- /* End of file from client */
- info->end_of_file = 1; return 1;
+ info->end_of_file= 0; /* End of file from client */
+ DBUG_RETURN(1);
}
/* to set up stuff for my_b_get (no _) */
- info->rc_end = (info->rc_pos = (byte*) net->read_pos) + read_length;
- Buffer[0] = info->rc_pos[0]; /* length is always 1 */
- info->rc_pos++;
- info->buffer = info->rc_pos;
- return 0;
+ info->read_end = (info->read_pos = (byte*) net->read_pos) + read_length;
+ Buffer[0] = info->read_pos[0]; /* length is always 1 */
+ info->read_pos++;
+
+ /*
+ info->request_pos is used by log_loaded_block() to know the size
+ of the current block
+ */
+ info->request_pos=info->read_pos;
+ DBUG_RETURN(0);
}
} /* extern "C" */