49
50
static const std::string DATE("DATE");
50
51
static const std::string EPOCH("EPOCH");
51
52
static const std::string TIMESTAMP("TIMESTAMP");
52
static const std::string MICROTIME("MICROTIME");
53
53
static const std::string DATETIME("DATETIME");
54
54
static const std::string TIME("TIME");
55
55
static const std::string UUID("UUID");
75
75
static const std::string MATCH_PARTIAL("PARTIAL");
76
76
static const std::string MATCH_SIMPLE("SIMPLE");
78
const static std::string STANDARD_STRING("STANDARD");
79
const static std::string TEMPORARY_STRING("TEMPORARY");
80
const static std::string INTERNAL_STRING("INTERNAL");
81
const static std::string FUNCTION_STRING("FUNCTION");
78
void init(drizzled::message::Table &arg, const std::string &name_arg, const std::string &schema_arg, const std::string &engine_arg)
80
arg.set_name(name_arg);
81
arg.set_schema(schema_arg);
82
arg.set_creation_timestamp(time(NULL));
83
arg.set_update_timestamp(time(NULL));
84
arg.mutable_engine()->set_name(engine_arg);
86
/* 36 characters for uuid string +1 for NULL */
89
uuid_generate_random(uu);
90
uuid_unparse(uu, uuid_string);
91
arg.set_uuid(uuid_string, 36);
96
void init(drizzled::message::Schema &arg, const std::string &name_arg)
98
arg.set_name(name_arg);
99
arg.mutable_engine()->set_name(std::string("filesystem")); // For the moment we have only one.
100
if (not arg.has_collation())
102
arg.set_collation(default_charset_info->name);
105
/* 36 characters for uuid string +1 for NULL */
107
char uuid_string[37];
108
uuid_generate_random(uu);
109
uuid_unparse(uu, uuid_string);
110
arg.set_uuid(uuid_string, 36);
83
115
void update(drizzled::message::Schema &arg)
252
284
return MATCH_SIMPLE;
255
const std::string &type(drizzled::message::Table::TableType type)
259
case message::Table::STANDARD:
260
return STANDARD_STRING;
261
case message::Table::TEMPORARY:
262
return TEMPORARY_STRING;
263
case message::Table::INTERNAL:
264
return INTERNAL_STRING;
265
case message::Table::FUNCTION:
266
return FUNCTION_STRING;
270
return PROGRAM_ERROR;
274
288
std::ostream& operator<<(std::ostream& output, const message::Transaction &message)