~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/log_event.cc

  • Committer: Monty Taylor
  • Date: 2008-11-18 22:12:56 UTC
  • mto: (589.1.3 devel)
  • mto: This revision was merged to the branch mainline in revision 589.
  • Revision ID: monty@inaugust.com-20081118221256-ap2kmj073pdw7uap
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
#include <drizzled/server_includes.h>
 
21
#include <drizzled/log_event.h>
21
22
#include <drizzled/replication/rli.h>
22
23
#include <drizzled/replication/mi.h>
23
24
#include <drizzled/replication/filter.h>
27
28
#include <drizzled/error.h>
28
29
#include <libdrizzle/pack.h>
29
30
#include <drizzled/sql_parse.h>
 
31
#include <drizzled/sql_base.h>
 
32
#include <drizzled/sql_load.h>
30
33
 
31
34
#include <algorithm>
32
35
 
633
636
}
634
637
 
635
638
 
 
639
const char* Log_event::get_db()
 
640
{
 
641
  return session ? session->db : 0;
 
642
}
 
643
 
 
644
 
636
645
/**
637
646
  init_show_field_list() prepares the column names and types for the
638
647
  output of SHOW BINLOG EVENTS; it is used only by SHOW BINLOG
643
652
{
644
653
  field_list->push_back(new Item_empty_string("Log_name", 20));
645
654
  field_list->push_back(new Item_return_int("Pos", MY_INT32_NUM_DECIMAL_DIGITS,
646
 
                                            DRIZZLE_TYPE_LONGLONG));
 
655
                                            DRIZZLE_TYPE_LONGLONG));
647
656
  field_list->push_back(new Item_empty_string("Event_type", 20));
648
657
  field_list->push_back(new Item_return_int("Server_id", 10,
649
 
                                            DRIZZLE_TYPE_LONG));
 
658
                                            DRIZZLE_TYPE_LONG));
650
659
  field_list->push_back(new Item_return_int("End_log_pos",
651
660
                                            MY_INT32_NUM_DECIMAL_DIGITS,
652
 
                                            DRIZZLE_TYPE_LONGLONG));
 
661
                                            DRIZZLE_TYPE_LONGLONG));
653
662
  field_list->push_back(new Item_empty_string("Info", 20));
654
663
}
655
664
 
730
739
}
731
740
 
732
741
 
 
742
time_t Log_event::get_time()
 
743
{
 
744
  Session *tmp_session;
 
745
  if (when)
 
746
    return when;
 
747
  if (session)
 
748
    return session->start_time;
 
749
  if ((tmp_session= current_session))
 
750
    return tmp_session->start_time;
 
751
  return my_time(0);
 
752
}
 
753
 
 
754
 
733
755
/**
734
756
  This needn't be format-tolerant, because we only read
735
757
  LOG_EVENT_MINIMAL_HEADER_LEN (we just want to read the event's length).
736
758
*/
737
759
 
738
760
int Log_event::read_log_event(IO_CACHE* file, String* packet,
739
 
                              pthread_mutex_t* log_lock)
 
761
                              pthread_mutex_t* log_lock)
740
762
{
741
763
  ulong data_len;
742
764
  int result=0;