~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/ha_myisam.cc

  • Committer: Brian Aker
  • Date: 2009-09-16 21:56:01 UTC
  • mfrom: (1126.2.5 merge)
  • Revision ID: brian@gaz-20090916215601-o8gy2wmwt0pgfp86
Merge Jay Alter table + Brian dead code

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>
29
28
#include <drizzled/table.h>
30
29
#include <drizzled/field/timestamp.h>
31
30
 
91
90
  int deleteTableImplementation(Session*, const string table_name);
92
91
};
93
92
 
94
 
// collect errors printed by mi_check routines
 
93
/* 
 
94
  Convert to push_Warnings if you ever care about this, otherwise, it is a no-op.
 
95
*/
95
96
 
96
 
static void mi_check_print_msg(MI_CHECK *param, const char* msg_type,
97
 
                               const char *fmt, va_list args)
 
97
static void mi_check_print_msg(MI_CHECK *,      const char* ,
 
98
                               const char *, va_list )
98
99
{
99
 
  Session* session = (Session*)param->session;
100
 
  drizzled::plugin::Protocol *protocol= session->protocol;
101
 
  uint32_t length, msg_length;
102
 
  char msgbuf[MI_MAX_MSG_BUF];
103
 
  char name[NAME_LEN*2+2];
104
 
 
105
 
  msg_length= vsnprintf(msgbuf, sizeof(msgbuf), fmt, args);
106
 
  msgbuf[sizeof(msgbuf) - 1] = 0; // healthy paranoia
107
 
 
108
 
  if (!session->protocol->isConnected())
109
 
  {
110
 
    errmsg_printf(ERRMSG_LVL_ERROR, "%s",msgbuf);
111
 
    return;
112
 
  }
113
 
 
114
 
  if (param->testflag & (T_CREATE_MISSING_KEYS | T_SAFE_REPAIR |
115
 
                         T_AUTO_REPAIR))
116
 
  {
117
 
    my_message(ER_NOT_KEYFILE,msgbuf,MYF(MY_WME));
118
 
    return;
119
 
  }
120
 
  length= sprintf(name,"%s.%s",param->db_name,param->table_name);
121
 
 
122
 
  /*
123
 
    TODO: switch from protocol to push_warning here. The main reason we didn't
124
 
    it yet is parallel repair. Due to following trace:
125
 
    mi_check_print_msg/push_warning/sql_alloc/my_pthread_getspecific_ptr.
126
 
 
127
 
    Also we likely need to lock mutex here (in both cases with protocol and
128
 
    push_warning).
129
 
  */
130
 
  protocol->prepareForResend();
131
 
  protocol->store(name, length);
132
 
  protocol->store(param->op_name);
133
 
  protocol->store(msg_type);
134
 
  protocol->store(msgbuf, msg_length);
135
 
  if (protocol->write())
136
 
    errmsg_printf(ERRMSG_LVL_ERROR, "Failed on drizzleclient_net_write, writing to stderr instead: %s\n",
137
 
                    msgbuf);
138
 
  return;
139
100
}
140
101
 
141
102