~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_error.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:
46
46
#include <drizzled/sql_base.h>
47
47
#include <drizzled/item/empty_string.h>
48
48
#include <drizzled/item/return_int.h>
 
49
#include <drizzled/plugin/client.h>
49
50
 
50
51
using namespace drizzled;
51
52
 
205
206
  field_list.push_back(new Item_return_int("Code",4, DRIZZLE_TYPE_LONG));
206
207
  field_list.push_back(new Item_empty_string("Message",DRIZZLE_ERRMSG_SIZE));
207
208
 
208
 
  if (session->protocol->sendFields(&field_list))
 
209
  if (session->client->sendFields(&field_list))
209
210
    return true;
210
211
 
211
212
  DRIZZLE_ERROR *err;
212
213
  Select_Lex *sel= &session->lex->select_lex;
213
214
  Select_Lex_Unit *unit= &session->lex->unit;
214
215
  ha_rows idx= 0;
215
 
  plugin::Protocol *protocol=session->protocol;
216
216
 
217
217
  unit->set_limit(sel);
218
218
 
226
226
      continue;
227
227
    if (idx > unit->select_limit_cnt)
228
228
      break;
229
 
    protocol->prepareForResend();
230
 
    protocol->store(warning_level_names[err->level].str,
231
 
                    warning_level_names[err->level].length);
232
 
    protocol->store((uint32_t) err->code);
233
 
    protocol->store(err->msg, strlen(err->msg));
234
 
    if (protocol->write())
 
229
    session->client->store(warning_level_names[err->level].str,
 
230
                           warning_level_names[err->level].length);
 
231
    session->client->store((uint32_t) err->code);
 
232
    session->client->store(err->msg, strlen(err->msg));
 
233
    if (session->client->flush())
235
234
      return(true);
236
235
  }
237
236
  session->my_eof();