00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <config.h>
00022
00023 #include <plugin/table_cache_dictionary/dictionary.h>
00024
00025 using namespace drizzled;
00026 using namespace std;
00027
00028 table_cache_dictionary::TableDefinitionCache::TableDefinitionCache() :
00029 plugin::TableFunction("DATA_DICTIONARY", "TABLE_DEFINITION_CACHE")
00030 {
00031 add_field("TABLE_SCHEMA");
00032 add_field("TABLE_NAME");
00033 add_field("VERSION", plugin::TableFunction::NUMBER, 0, false);
00034 add_field("TABLE_COUNT", plugin::TableFunction::NUMBER, 0, false);
00035 add_field("IS_NAME_LOCKED", plugin::TableFunction::BOOLEAN, 0, false);
00036 }
00037
00038 table_cache_dictionary::TableDefinitionCache::Generator::Generator(drizzled::Field **arg) :
00039 drizzled::plugin::TableFunction::Generator(arg)
00040 {
00041 }
00042
00043 table_cache_dictionary::TableDefinitionCache::Generator::~Generator()
00044 {
00045 }
00046
00047 bool table_cache_dictionary::TableDefinitionCache::Generator::populate()
00048 {
00049 drizzled::TableShare::shared_ptr share;
00050
00051 while ((share= table_definition_cache_generator))
00052 {
00058
00059 string arg;
00060 push(share->getSchemaName(arg));
00061
00062
00063 push(share->getTableName(arg));
00064
00065
00066 push(static_cast<int64_t>(share->getVersion()));
00067
00068
00069 push(static_cast<uint64_t>(share->getTableCount()));
00070
00071
00072 push(false);
00073
00074 return true;
00075 }
00076
00077 return false;
00078 }