46
46
drizzled::plugin::TableFunction::Generator(arg),
49
Session *session= current_session;
50
statement::Select *select= static_cast<statement::Select *>(session->lex->statement);
49
statement::Select *select= static_cast<statement::Select *>(getSession().lex->statement);
52
51
schema_predicate.append(select->getShowSchema());
54
pthread_mutex_lock(&LOCK_open); /* Optionally lock for remove tables from open_cahe if not in use */
56
drizzled::HASH *open_cache=
59
for (uint32_t idx= 0; idx < open_cache->records; idx++ )
53
if (schema_predicate.empty())
61
table= (Table*) hash_element(open_cache, idx);
62
table_list.push_back(table);
55
schema_predicate.append(getSession().db);
65
for (table= session->temporary_tables; table; table= table->next)
58
if (not schema_predicate.empty())
67
if (table->getShare())
60
pthread_mutex_lock(&LOCK_open); /* Optionally lock for remove tables from open_cahe if not in use */
62
drizzled::HASH *open_cache=
65
for (uint32_t idx= 0; idx < open_cache->records; idx++ )
67
table= (Table*) hash_element(open_cache, idx);
69
68
table_list.push_back(table);
71
for (table= getSession().temporary_tables; table; table= table->next)
73
if (table->getShare())
75
table_list.push_back(table);
78
std::sort(table_list.begin(), table_list.end(), Table::compare);
72
std::sort(table_list.begin(), table_list.end(), Table::compare);
75
82
ShowTableStatus::Generator::~Generator()