~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/mysql_protocol/mysql_protocol.cc

  • Committer: Mark Atwood
  • Date: 2011-06-03 17:57:03 UTC
  • mfrom: (2313.3.6 void)
  • Revision ID: me@mark.atwood.name-20110603175703-idsui337bghio245
mergeĀ lp:~olafvdspek/drizzle/void2

Show diffs side-by-side

added added

removed removed

Lines of Context:
504
504
 
505
505
    packet.length(0);
506
506
 
507
 
    if (store(STRING_WITH_LEN("def")) ||
508
 
        store(field.db_name) ||
509
 
        store(field.table_name) ||
510
 
        store(field.org_table_name) ||
511
 
        store(field.col_name) ||
512
 
        store(field.org_col_name))
513
 
      goto err;
 
507
    store(STRING_WITH_LEN("def"));
 
508
    store(field.db_name);
 
509
    store(field.table_name);
 
510
    store(field.org_table_name);
 
511
    store(field.col_name);
 
512
    store(field.org_col_name);
514
513
    packet.realloc(packet.length()+12);
515
514
 
516
515
    /* Store fixed length fields */
609
608
    Send no warning information, as it will be sent at statement end.
610
609
  */
611
610
  writeEOFPacket(session->server_status, session->total_warn_count);
612
 
  return 0;
613
 
 
614
 
err:
615
 
  my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES),
616
 
             MYF(0));
617
 
  return 1;
 
611
  return 0; // return void
618
612
}
619
613
 
620
 
bool ClientMySQLProtocol::store(Field *from)
 
614
void ClientMySQLProtocol::store(Field *from)
621
615
{
622
616
  if (from->is_null())
623
617
    return store();
632
626
  from->val_str_internal(&str);
633
627
 
634
628
  netStoreData((const unsigned char *)str.ptr(), str.length());
635
 
  return 0; // return void
636
629
}
637
630
 
638
 
bool ClientMySQLProtocol::store()
 
631
void ClientMySQLProtocol::store()
639
632
{
640
633
  char buff[1];
641
634
  buff[0]= (char)251;
642
635
  packet.append(buff, sizeof(buff), PACKET_BUFFER_EXTRA_ALLOC);
643
 
        return false; // return void
644
636
}
645
637
 
646
 
bool ClientMySQLProtocol::store(int32_t from)
 
638
void ClientMySQLProtocol::store(int32_t from)
647
639
{
648
640
  char buff[12];
649
641
  netStoreData((unsigned char*) buff,
650
642
                      (size_t) (internal::int10_to_str(from, buff, -10) - buff));
651
 
  return 0; // return void
652
643
}
653
644
 
654
 
bool ClientMySQLProtocol::store(uint32_t from)
 
645
void ClientMySQLProtocol::store(uint32_t from)
655
646
{
656
647
  char buff[11];
657
648
  netStoreData((unsigned char*) buff,
658
649
                      (size_t) (internal::int10_to_str(from, buff, 10) - buff));
659
 
  return 0; // return void
660
650
}
661
651
 
662
 
bool ClientMySQLProtocol::store(int64_t from)
 
652
void ClientMySQLProtocol::store(int64_t from)
663
653
{
664
654
  char buff[22];
665
655
  netStoreData((unsigned char*) buff,
666
656
                      (size_t) (internal::int64_t10_to_str(from, buff, -10) - buff));
667
 
  return 0; // return void
668
657
}
669
658
 
670
 
bool ClientMySQLProtocol::store(uint64_t from)
 
659
void ClientMySQLProtocol::store(uint64_t from)
671
660
{
672
661
  char buff[21];
673
662
  netStoreData((unsigned char*) buff,
674
663
                      (size_t) (internal::int64_t10_to_str(from, buff, 10) - buff));
675
 
  return 0; // return void
676
664
}
677
665
 
678
 
bool ClientMySQLProtocol::store(double from, uint32_t decimals, String *buffer)
 
666
void ClientMySQLProtocol::store(double from, uint32_t decimals, String *buffer)
679
667
{
680
668
  buffer->set_real(from, decimals, session->charset());
681
669
  netStoreData((unsigned char*) buffer->ptr(), buffer->length());
682
 
  return 0; // return void
683
670
}
684
671
 
685
 
bool ClientMySQLProtocol::store(const char *from, size_t length)
 
672
void ClientMySQLProtocol::store(const char *from, size_t length)
686
673
{
687
674
  netStoreData((const unsigned char *)from, length);
688
 
  return 0; // return void
689
675
}
690
676
 
691
 
bool ClientMySQLProtocol::wasAborted(void)
 
677
bool ClientMySQLProtocol::wasAborted()
692
678
{
693
679
  return net.error && net.vio != 0;
694
680
}
695
681
 
696
 
bool ClientMySQLProtocol::haveMoreData(void)
 
682
bool ClientMySQLProtocol::haveMoreData()
697
683
{
698
684
  return drizzleclient_net_more_data(&net);
699
685
}
700
686
 
701
 
bool ClientMySQLProtocol::haveError(void)
 
687
bool ClientMySQLProtocol::haveError()
702
688
{
703
689
  return net.error || net.vio == 0;
704
690
}
705
691
 
706
 
bool ClientMySQLProtocol::checkConnection(void)
 
692
bool ClientMySQLProtocol::checkConnection()
707
693
{
708
694
  uint32_t pkt_len= 0;
709
695
  char *end;