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>
91
90
int deleteTableImplementation(Session*, const string table_name);
94
// collect errors printed by mi_check routines
94
Convert to push_Warnings if you ever care about this, otherwise, it is a no-op.
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 )
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];
105
msg_length= vsnprintf(msgbuf, sizeof(msgbuf), fmt, args);
106
msgbuf[sizeof(msgbuf) - 1] = 0; // healthy paranoia
108
if (!session->protocol->isConnected())
110
errmsg_printf(ERRMSG_LVL_ERROR, "%s",msgbuf);
114
if (param->testflag & (T_CREATE_MISSING_KEYS | T_SAFE_REPAIR |
117
my_message(ER_NOT_KEYFILE,msgbuf,MYF(MY_WME));
120
length= sprintf(name,"%s.%s",param->db_name,param->table_name);
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.
127
Also we likely need to lock mutex here (in both cases with protocol and
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",