25
25
using namespace drizzled;
27
27
SchemasTool::SchemasTool() :
28
plugin::TableFunction("DATA_DICTIONARY", "SCHEMAS")
28
DataDictionary("SCHEMAS")
30
30
add_field("SCHEMA_NAME");
31
31
add_field("DEFAULT_COLLATION_NAME");
36
36
add_field("SCHEMA_USE_COUNT", plugin::TableFunction::NUMBER, 0, true);
39
SchemasTool::Generator::Generator(Field **arg) :
40
plugin::TableFunction::Generator(arg),
39
SchemasTool::Generator::Generator(drizzled::Field **arg) :
40
DataDictionary::Generator(arg),
41
41
schema_generator(getSession())
45
bool SchemasTool::Generator::nextSchema()
45
bool SchemasTool::Generator::populate()
47
47
drizzled::message::SchemaPtr schema_ptr;
48
48
while ((schema_ptr= schema_generator))
58
bool SchemasTool::Generator::populate()
70
A lack of a parsed schema file means we are using defaults.
72
void SchemasTool::Generator::fill()
77
/* DEFAULT_COLLATION_NAME */
78
push(schema->collation());
80
/* SCHEMA_CREATION_TIME */
81
time_t time_arg= schema->creation_timestamp();
85
localtime_r(&time_arg, &tm_buffer);
86
strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", &tm_buffer);
89
/* SCHEMA_UPDATE_TIME */
90
time_arg= schema->update_timestamp();
91
localtime_r(&time_arg, &tm_buffer);
92
strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", &tm_buffer);
99
push(schema->version());
101
/* SCHEMA_USE_COUNT */
102
push(schema->version());
51
push(schema_ptr->name());
53
/* DEFAULT_COLLATION_NAME */
54
push(schema_ptr->collation());
56
/* SCHEMA_CREATION_TIME */
57
time_t time_arg= schema_ptr->creation_timestamp();
61
localtime_r(&time_arg, &tm_buffer);
62
strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", &tm_buffer);
65
/* SCHEMA_UPDATE_TIME */
66
time_arg= schema_ptr->update_timestamp();
67
localtime_r(&time_arg, &tm_buffer);
68
strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", &tm_buffer);
72
push(schema_ptr->uuid());
75
push(schema_ptr->version());
77
/* SCHEMA_USE_COUNT */
78
push(schema_ptr->version());