~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/mysql_protocol/mysql_protocol.cc

  • Committer: Mark Atwood
  • Date: 2011-12-15 23:13:18 UTC
  • mfrom: (2465.3.1 rf3)
  • Revision ID: me@mark.atwood.name-20111215231318-mt2y2q4s5ydp79q3
mergeĀ lp:~olafvdspek/drizzle/refactor14

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
#include <config.h>
 
21
 
 
22
#include <boost/program_options.hpp>
 
23
 
 
24
#include <algorithm>
 
25
#include <climits>
 
26
 
21
27
#include <drizzled/gettext.h>
22
28
#include <drizzled/error.h>
23
29
#include <drizzled/error/sql_state.h>
24
30
#include <drizzled/session.h>
25
31
#include <drizzled/internal/m_string.h>
26
 
#include <algorithm>
27
 
#include <boost/program_options.hpp>
28
32
#include <drizzled/module/option_map.h>
29
33
#include <drizzled/util/tokenize.h>
30
 
#include "errmsg.h"
31
 
#include "mysql_protocol.h"
32
 
#include "mysql_password.h"
33
 
#include "options.h"
 
34
#include <plugin/mysql_protocol/errmsg.h>
 
35
#include <plugin/mysql_protocol/mysql_protocol.h>
 
36
#include <plugin/mysql_protocol/mysql_password.h>
 
37
#include <plugin/mysql_protocol/options.h>
34
38
#include <drizzled/identifier.h>
35
39
#include <drizzled/plugin/function.h>
36
40
#include <drizzled/diagnostics_area.h>
37
41
#include <drizzled/system_variables.h>
38
 
#include <libdrizzle/constants.h>
 
42
#include <libdrizzle-2.0/constants.h>
39
43
 
40
44
#define MIN_HANDSHAKE_SIZE 6
41
45
#define PROTOCOL_VERSION 10
405
409
  char *tmp= strncpy((char*)pos, err, DRIZZLE_ERRMSG_SIZE-1);
406
410
  tmp+= strlen((char*)pos);
407
411
  tmp[0]= '\0';
408
 
  net.write_command(255, data_ref().clear(), data_ref(buff, tmp));
 
412
  net.write_command(255, data_ref(), data_ref(buff, tmp));
409
413
  net.flush();
410
414
  session->main_da().can_overwrite_status= false;
411
415
}
686
690
    *end++= 0; /* an empty byte for some reason */
687
691
 
688
692
    /* At this point we write connection message and read reply */
689
 
    if (net.write_command(PROTOCOL_VERSION, data_ref().clear(), data_ref(buff, end)) 
 
693
    if (net.write_command(PROTOCOL_VERSION, data_ref(), data_ref(buff, end)) 
690
694
        || (pkt_len= net.read()) == packet_error 
691
695
        || pkt_len < MIN_HANDSHAKE_SIZE)
692
696
    {