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");
56
static const std::string BOOLEAN("BOOLEAN");
58
57
static const std::string UNDEFINED("UNDEFINED");
59
58
static const std::string RESTRICT("RESTRICT");
75
74
static const std::string MATCH_PARTIAL("PARTIAL");
76
75
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");
77
void init(drizzled::message::Table &arg, const std::string &name_arg, const std::string &schema_arg, const std::string &engine_arg)
79
arg.set_name(name_arg);
80
arg.set_schema(schema_arg);
81
arg.set_creation_timestamp(time(NULL));
82
arg.set_update_timestamp(time(NULL));
83
arg.mutable_engine()->set_name(engine_arg);
85
/* 36 characters for uuid string +1 for NULL */
88
uuid_generate_random(uu);
89
uuid_unparse(uu, uuid_string);
90
arg.set_uuid(uuid_string, 36);
95
void init(drizzled::message::Schema &arg, const std::string &name_arg)
97
arg.set_name(name_arg);
98
arg.mutable_engine()->set_name(std::string("filesystem")); // For the moment we have only one.
99
if (not arg.has_collation())
101
arg.set_collation(default_charset_info->name);
104
/* 36 characters for uuid string +1 for NULL */
106
char uuid_string[37];
107
uuid_generate_random(uu);
108
uuid_unparse(uu, uuid_string);
109
arg.set_uuid(uuid_string, 36);
83
114
void update(drizzled::message::Schema &arg)
252
278
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
282
std::ostream& operator<<(std::ostream& output, const message::Transaction &message)