~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message.cc

  • Committer: Brian Aker
  • Date: 2011-01-11 07:12:09 UTC
  • mfrom: (2068.5.6 catalogs)
  • Revision ID: brian@gir-3-20110111071209-ntbex8btgayoq00v
MergeĀ inĀ catalogs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include "drizzled/message/schema.pb.h"
31
31
 
32
32
#include <string>
33
 
#include <uuid/uuid.h>
34
33
 
35
34
namespace drizzled {
36
35
namespace message {
76
75
static const std::string MATCH_PARTIAL("PARTIAL");
77
76
static const std::string MATCH_SIMPLE("SIMPLE");
78
77
 
79
 
void init(drizzled::message::Table &arg, const std::string &name_arg, const std::string &schema_arg, const std::string &engine_arg)
80
 
{
81
 
  arg.set_name(name_arg);
82
 
  arg.set_schema(schema_arg);
83
 
  arg.set_creation_timestamp(time(NULL));
84
 
  arg.set_update_timestamp(time(NULL));
85
 
  arg.mutable_engine()->set_name(engine_arg);
86
 
 
87
 
  /* 36 characters for uuid string +1 for NULL */
88
 
  uuid_t uu;
89
 
  char uuid_string[37];
90
 
  uuid_generate_random(uu);
91
 
  uuid_unparse(uu, uuid_string);
92
 
  arg.set_uuid(uuid_string, 36);
93
 
 
94
 
  arg.set_version(1);
95
 
}
96
 
 
97
 
void init(drizzled::message::Schema &arg, const std::string &name_arg)
98
 
{
99
 
  arg.set_name(name_arg);
100
 
  arg.mutable_engine()->set_name(std::string("filesystem")); // For the moment we have only one.
101
 
  if (not arg.has_collation())
102
 
  {
103
 
    arg.set_collation(default_charset_info->name);
104
 
  }
105
 
 
106
 
  /* 36 characters for uuid string +1 for NULL */
107
 
  uuid_t uu;
108
 
  char uuid_string[37];
109
 
  uuid_generate_random(uu);
110
 
  uuid_unparse(uu, uuid_string);
111
 
  arg.set_uuid(uuid_string, 36);
112
 
 
113
 
  arg.set_version(1);
114
 
}
115
 
 
116
78
void update(drizzled::message::Schema &arg)
117
79
{
118
80
  arg.set_version(arg.version() + 1);