~maria-captains/mariadb-native-client/trunk

« back to all changes in this revision

Viewing changes to libmariadb/net.c

  • Committer: holzboote at googlemail
  • Date: 2013-10-26 16:55:24 UTC
  • Revision ID: holzboote@googlemail.com-20131026165524-oqqa5pg2k7c74dc6
Minor prepared statement fixes for time/date/datetime/timestamp types
Added flag MADB_BIND_DUMMY which allows binding empty buffers

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
 
112
112
int my_net_init(NET *net, Vio* vio)
113
113
{
114
 
  if (!(net->buff=(uchar*) my_malloc(net_buffer_length,MYF(MY_WME))))
 
114
  if (!(net->buff=(uchar*) my_malloc(net_buffer_length,MYF(MY_WME | MY_ZEROFILL))))
115
115
    return 1;
116
116
  if (net_buffer_length > max_allowed_packet)
117
117
    max_allowed_packet=net_buffer_length;
220
220
  if (net->buff != net->write_pos)
221
221
  {
222
222
    error=net_real_write(net,(char*) net->buff,
223
 
                         (uint) (net->write_pos - net->buff));
 
223
                         (size_t) (net->write_pos - net->buff));
224
224
    net->write_pos=net->buff;
225
225
  }
226
226
  if (net->compress)
274
274
  size_t length= 1 + len; /* 1 extra byte for command */
275
275
  int rc;
276
276
 
 
277
  buff[NET_HEADER_SIZE]= 0;
277
278
  buff[4]=command;
278
279
 
279
280
  if (length >= MAX_PACKET_LENGTH)
401
402
  pos=(char*) packet; end=pos+len;
402
403
  while (pos != end)
403
404
  {
404
 
    if ((long) (length=vio_write(net->vio,pos,(int) (end-pos))) <= 0)
 
405
    if ((long) (length=vio_write(net->vio,pos,(size_t) (end-pos))) <= 0)
405
406
    {
406
407
      my_bool interrupted = vio_should_retry(net->vio);
407
408
#if (!defined(_WIN32) && !defined(__EMX__) && !defined(OS2))