~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/ha_myisam.cc

  • Committer: Eric Day
  • Date: 2009-08-06 07:14:37 UTC
  • mto: This revision was merged to the branch mainline in revision 1131.
  • Revision ID: eday@oddments.org-20090806071437-c3baqgtvsdxp1l1a
Renamed Protocol to Client, cleaned up some unnecessary methods along the way.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <drizzled/errmsg_print.h>
26
26
#include <drizzled/gettext.h>
27
27
#include <drizzled/session.h>
28
 
#include <drizzled/plugin/protocol.h>
 
28
#include <drizzled/plugin/client.h>
29
29
#include <drizzled/table.h>
30
30
#include <drizzled/field/timestamp.h>
31
31
 
99
99
                               const char *fmt, va_list args)
100
100
{
101
101
  Session* session = (Session*)param->session;
102
 
  drizzled::plugin::Protocol *protocol= session->protocol;
103
102
  uint32_t length, msg_length;
104
103
  char msgbuf[MI_MAX_MSG_BUF];
105
104
  char name[NAME_LEN*2+2];
107
106
  msg_length= vsnprintf(msgbuf, sizeof(msgbuf), fmt, args);
108
107
  msgbuf[sizeof(msgbuf) - 1] = 0; // healthy paranoia
109
108
 
110
 
  if (!session->protocol->isConnected())
 
109
  if (!session->client->isConnected())
111
110
  {
112
111
    errmsg_printf(ERRMSG_LVL_ERROR, "%s",msgbuf);
113
112
    return;
122
121
  length= sprintf(name,"%s.%s",param->db_name,param->table_name);
123
122
 
124
123
  /*
125
 
    TODO: switch from protocol to push_warning here. The main reason we didn't
 
124
    TODO: switch from client to push_warning here. The main reason we didn't
126
125
    it yet is parallel repair. Due to following trace:
127
126
    mi_check_print_msg/push_warning/sql_alloc/my_pthread_getspecific_ptr.
128
127
 
129
 
    Also we likely need to lock mutex here (in both cases with protocol and
 
128
    Also we likely need to lock mutex here (in both cases with client and
130
129
    push_warning).
131
130
  */
132
 
  protocol->prepareForResend();
133
 
  protocol->store(name, length);
134
 
  protocol->store(param->op_name);
135
 
  protocol->store(msg_type);
136
 
  protocol->store(msgbuf, msg_length);
137
 
  if (protocol->write())
 
131
  session->client->store(name, length);
 
132
  session->client->store(param->op_name);
 
133
  session->client->store(msg_type);
 
134
  session->client->store(msgbuf, msg_length);
 
135
  if (session->client->flush())
138
136
    errmsg_printf(ERRMSG_LVL_ERROR, "Failed on drizzleclient_net_write, writing to stderr instead: %s\n",
139
137
                    msgbuf);
140
138
  return;