~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/handler.cc

  • Committer: Brian Aker
  • Date: 2009-09-22 07:35:28 UTC
  • mfrom: (971.6.10 eday-dev)
  • Revision ID: brian@gaz-20090922073528-xgm634aomuflqxl3
MergeĀ Eric

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
using namespace drizzled;
797
798
bool mysql_xa_recover(Session *session)
798
799
{
799
800
  List<Item> field_list;
800
 
  plugin::Protocol *protocol= session->protocol;
801
801
  int i= 0;
802
802
  XID_STATE *xs;
803
803
 
806
806
  field_list.push_back(new Item_int("bqual_length", 0, MY_INT32_NUM_DECIMAL_DIGITS));
807
807
  field_list.push_back(new Item_empty_string("data",XIDDATASIZE));
808
808
 
809
 
  if (protocol->sendFields(&field_list))
 
809
  if (session->client->sendFields(&field_list))
810
810
    return 1;
811
811
 
812
812
  pthread_mutex_lock(&LOCK_xid_cache);
814
814
  {
815
815
    if (xs->xa_state==XA_PREPARED)
816
816
    {
817
 
      protocol->prepareForResend();
818
 
      protocol->store((int64_t)xs->xid.formatID);
819
 
      protocol->store((int64_t)xs->xid.gtrid_length);
820
 
      protocol->store((int64_t)xs->xid.bqual_length);
821
 
      protocol->store(xs->xid.data, xs->xid.gtrid_length+xs->xid.bqual_length);
822
 
      if (protocol->write())
 
817
      session->client->store((int64_t)xs->xid.formatID);
 
818
      session->client->store((int64_t)xs->xid.gtrid_length);
 
819
      session->client->store((int64_t)xs->xid.bqual_length);
 
820
      session->client->store(xs->xid.data,
 
821
                             xs->xid.gtrid_length+xs->xid.bqual_length);
 
822
      if (session->client->flush())
823
823
      {
824
824
        pthread_mutex_unlock(&LOCK_xid_cache);
825
825
        return 1;
2606
2606
                       const char *file, uint32_t file_len,
2607
2607
                       const char *status, uint32_t status_len)
2608
2608
{
2609
 
  plugin::Protocol *protocol= session->protocol;
2610
 
  protocol->prepareForResend();
2611
 
  protocol->store(type, type_len);
2612
 
  protocol->store(file, file_len);
2613
 
  protocol->store(status, status_len);
2614
 
  if (protocol->write())
 
2609
  session->client->store(type, type_len);
 
2610
  session->client->store(file, file_len);
 
2611
  session->client->store(status, status_len);
 
2612
  if (session->client->flush())
2615
2613
    return true;
2616
2614
  return false;
2617
2615
}
2619
2617
bool ha_show_status(Session *session, StorageEngine *engine, enum ha_stat_type stat)
2620
2618
{
2621
2619
  List<Item> field_list;
2622
 
  plugin::Protocol *protocol= session->protocol;
2623
2620
  bool result;
2624
2621
 
2625
2622
  field_list.push_back(new Item_empty_string("Type",10));
2626
2623
  field_list.push_back(new Item_empty_string("Name",FN_REFLEN));
2627
2624
  field_list.push_back(new Item_empty_string("Status",10));
2628
2625
 
2629
 
  if (protocol->sendFields(&field_list))
 
2626
  if (session->client->sendFields(&field_list))
2630
2627
    return true;
2631
2628
 
2632
2629
  result= engine->show_status(session, stat_print, stat) ? 1 : 0;