~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/handler/replication_dictionary.cc

edit

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <config.h>
 
21
#include "config.h"
22
22
 
23
23
#include "replication_dictionary.h"
24
 
#include <drizzled/current_session.h>
 
24
#include "drizzled/current_session.h"
25
25
 
26
26
#include "univ.i"
27
27
#include "btr0sea.h"
52
52
#include "ha_prototypes.h"
53
53
#include "ut0mem.h"
54
54
#include "ibuf0ibuf.h"
 
55
#include "mysql_addons.h"
55
56
#include "create_replication.h"
56
57
#include "read_replication.h"
57
58
#include "handler0vars.h"
58
59
 
59
 
#include <drizzled/drizzled.h>
60
 
 
61
 
#include <drizzled/replication_services.h>
 
60
#include "drizzled/replication_services.h"
62
61
 
63
62
#include <google/protobuf/io/zero_copy_stream.h>
64
63
#include <google/protobuf/io/zero_copy_stream_impl.h>
76
75
  plugin::TableFunction("DATA_DICTIONARY", "INNODB_REPLICATION_LOG")
77
76
{
78
77
  add_field("TRANSACTION_ID", plugin::TableFunction::NUMBER, 0, false);
79
 
  add_field("TRANSACTION_SEGMENT_ID", plugin::TableFunction::NUMBER, 0, false);
80
 
  add_field("COMMIT_ID", plugin::TableFunction::NUMBER, 0, false);
81
 
  add_field("END_TIMESTAMP", plugin::TableFunction::NUMBER, 0, false);
82
 
  add_field("TRANSACTION_MESSAGE_STRING", plugin::TableFunction::STRING, transaction_message_threshold, false);
 
78
  add_field("TRANSACTION_MESSAGE_STRING", plugin::TableFunction::STRING, 2048, false);
 
79
  add_field("TRANSACTION_MESSAGE_BINARY", plugin::TableFunction::VARBINARY, 2048, false);
83
80
  add_field("TRANSACTION_LENGTH", plugin::TableFunction::NUMBER, 0, false);
84
81
}
85
82
 
101
98
  if (ret.message == NULL)
102
99
    return false;
103
100
 
104
 
  /* Transaction ID */
105
 
  push(static_cast<uint64_t>(ret.id));
106
 
 
107
 
  /* Segment ID */
108
 
  push(static_cast<uint64_t>(ret.seg_id));
109
 
 
110
 
  push(static_cast<uint64_t>(ret.commit_id));
111
 
 
112
 
  push(static_cast<uint64_t>(ret.end_timestamp));
113
 
  
 
101
  /* TABLE_NAME */
 
102
  push(static_cast<int64_t>(ret.id));
 
103
 
114
104
  /* Message in viewable format */
115
105
  bool result= message.ParseFromArray(ret.message, ret.message_length);
116
106
 
118
108
  {
119
109
    fprintf(stderr, _("Unable to parse transaction. Got error: %s.\n"), message.InitializationErrorString().c_str());
120
110
    push("error");
 
111
    push("error");
121
112
  }
122
113
  else
123
114
  {
124
115
    google::protobuf::TextFormat::PrintToString(message, &transaction_text);
125
116
    push(transaction_text);
 
117
    push(ret.message, ret.message_length);
126
118
  }
127
119
 
128
120
  push(static_cast<int64_t>(ret.message_length));