~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/mysql_protocol/net_serv.cc

  • Committer: Stewart Smith
  • Date: 2011-02-24 07:46:16 UTC
  • mto: (2200.1.2 drizzle-staging)
  • mto: This revision was merged to the branch mainline in revision 2201.
  • Revision ID: stewart@flamingspork.com-20110224074616-l2rmp406vf78x71q
add ER_NO_LOCK_HELD error code, and expect it in case of UNLOCK TABLES without any locks held.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include "config.h"
 
21
#include <config.h>
 
22
 
 
23
#include <drizzled/current_session.h>
 
24
#include <drizzled/error.h>
22
25
#include <drizzled/session.h>
23
 
#include <drizzled/error.h>
24
26
 
25
27
#include <assert.h>
26
28
#include <stdio.h>
95
97
{
96
98
  Vio *vio_tmp= new Vio(sock);
97
99
  if (vio_tmp == NULL)
 
100
  {
98
101
    return true;
 
102
  }
99
103
  else
100
104
    if (drizzleclient_net_init(net, vio_tmp, buffer_length))
101
105
    {
103
107
       * NET object.
104
108
       */
105
109
      if (vio_tmp && (net->vio != vio_tmp))
 
110
      {
106
111
        delete vio_tmp;
 
112
      }
107
113
      else
108
114
      {
109
115
        (void) shutdown(sock, SHUT_RDWR);
124
130
 
125
131
void drizzleclient_net_close(NET *net)
126
132
{
127
 
  if (net->vio != NULL)
128
 
  {
129
 
    delete net->vio;
130
 
    net->vio= 0;
131
 
  }
 
133
  drizzled::safe_delete(net->vio);
132
134
}
133
135
 
134
136
bool drizzleclient_net_peer_addr(NET *net, char *buf, uint16_t *port, size_t buflen)
579
581
      break;
580
582
    }
581
583
    pos+=length;
582
 
    current_session->status_var.bytes_sent+= length;
 
584
 
 
585
    /* If this is an error we may not have a current_session any more */
 
586
    if (current_session)
 
587
      current_session->status_var.bytes_sent+= length;
583
588
  }
584
589
end:
585
590
  if ((net->compress) && (packet != NULL))
852
857
        }
853
858
      }
854
859
      else
 
860
      {
855
861
        complen= packet_len;
 
862
      }
856
863
 
857
864
    }
858
865
    buf_length+= complen;