~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/handler.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:
39
39
#include "drizzled/unireg.h" // for mysql_frm_type
40
40
#include "drizzled/field/timestamp.h"
41
41
#include "drizzled/message/table.pb.h"
 
42
#include "drizzled/plugin/client.h"
42
43
 
43
44
using namespace std;
44
45
 
799
800
bool mysql_xa_recover(Session *session)
800
801
{
801
802
  List<Item> field_list;
802
 
  drizzled::plugin::Protocol *protocol= session->protocol;
803
803
  int i=0;
804
804
  XID_STATE *xs;
805
805
 
808
808
  field_list.push_back(new Item_int("bqual_length", 0, MY_INT32_NUM_DECIMAL_DIGITS));
809
809
  field_list.push_back(new Item_empty_string("data",XIDDATASIZE));
810
810
 
811
 
  if (protocol->sendFields(&field_list))
 
811
  if (session->client->sendFields(&field_list))
812
812
    return 1;
813
813
 
814
814
  pthread_mutex_lock(&LOCK_xid_cache);
816
816
  {
817
817
    if (xs->xa_state==XA_PREPARED)
818
818
    {
819
 
      protocol->prepareForResend();
820
 
      protocol->store((int64_t)xs->xid.formatID);
821
 
      protocol->store((int64_t)xs->xid.gtrid_length);
822
 
      protocol->store((int64_t)xs->xid.bqual_length);
823
 
      protocol->store(xs->xid.data, xs->xid.gtrid_length+xs->xid.bqual_length);
824
 
      if (protocol->write())
 
819
      session->client->store((int64_t)xs->xid.formatID);
 
820
      session->client->store((int64_t)xs->xid.gtrid_length);
 
821
      session->client->store((int64_t)xs->xid.bqual_length);
 
822
      session->client->store(xs->xid.data,
 
823
                             xs->xid.gtrid_length+xs->xid.bqual_length);
 
824
      if (session->client->flush())
825
825
      {
826
826
        pthread_mutex_unlock(&LOCK_xid_cache);
827
827
        return 1;
2626
2626
                       const char *file, uint32_t file_len,
2627
2627
                       const char *status, uint32_t status_len)
2628
2628
{
2629
 
  drizzled::plugin::Protocol *protocol= session->protocol;
2630
 
  protocol->prepareForResend();
2631
 
  protocol->store(type, type_len);
2632
 
  protocol->store(file, file_len);
2633
 
  protocol->store(status, status_len);
2634
 
  if (protocol->write())
 
2629
  session->client->store(type, type_len);
 
2630
  session->client->store(file, file_len);
 
2631
  session->client->store(status, status_len);
 
2632
  if (session->client->flush())
2635
2633
    return true;
2636
2634
  return false;
2637
2635
}
2639
2637
bool ha_show_status(Session *session, StorageEngine *engine, enum ha_stat_type stat)
2640
2638
{
2641
2639
  List<Item> field_list;
2642
 
  drizzled::plugin::Protocol *protocol= session->protocol;
2643
2640
  bool result;
2644
2641
 
2645
2642
  field_list.push_back(new Item_empty_string("Type",10));
2646
2643
  field_list.push_back(new Item_empty_string("Name",FN_REFLEN));
2647
2644
  field_list.push_back(new Item_empty_string("Status",10));
2648
2645
 
2649
 
  if (protocol->sendFields(&field_list))
 
2646
  if (session->client->sendFields(&field_list))
2650
2647
    return true;
2651
2648
 
2652
2649
  result= engine->show_status(session, stat_print, stat) ? 1 : 0;