~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

  • Committer: Brian Aker
  • Date: 2010-11-11 18:59:06 UTC
  • mto: This revision was merged to the branch mainline in revision 1927.
  • Revision ID: brian@tangent.org-20101111185906-at4lyjpv9aewg3fz
Encapsulate temporary tables.

Show diffs side-by-side

added added

removed removed

Lines of Context:
517
517
}
518
518
 
519
519
 
520
 
void Session::doGetTableNames(const SchemaIdentifier &schema_identifier,
521
 
                              std::set<std::string>& set_of_names)
 
520
void Open_tables_state::doGetTableNames(const SchemaIdentifier &schema_identifier,
 
521
                                        std::set<std::string>& set_of_names)
522
522
{
523
 
  for (Table *table= temporary_tables ; table ; table= table->getNext())
 
523
  for (Table *table= getTemporaryTables() ; table ; table= table->getNext())
524
524
  {
525
525
    if (schema_identifier.compare(table->getShare()->getSchemaName()))
526
526
    {
529
529
  }
530
530
}
531
531
 
532
 
void Session::doGetTableNames(CachedDirectory &,
533
 
                              const SchemaIdentifier &schema_identifier,
534
 
                              std::set<std::string> &set_of_names)
 
532
void Open_tables_state::doGetTableNames(CachedDirectory &,
 
533
                                        const SchemaIdentifier &schema_identifier,
 
534
                                        std::set<std::string> &set_of_names)
535
535
{
536
536
  doGetTableNames(schema_identifier, set_of_names);
537
537
}
538
538
 
539
 
void Session::doGetTableIdentifiers(const SchemaIdentifier &schema_identifier,
540
 
                                    TableIdentifiers &set_of_identifiers)
 
539
void Open_tables_state::doGetTableIdentifiers(const SchemaIdentifier &schema_identifier,
 
540
                                              TableIdentifiers &set_of_identifiers)
541
541
{
542
 
  for (Table *table= temporary_tables ; table ; table= table->getNext())
 
542
  for (Table *table= getTemporaryTables() ; table ; table= table->getNext())
543
543
  {
544
544
    if (schema_identifier.compare(table->getShare()->getSchemaName()))
545
545
    {
550
550
  }
551
551
}
552
552
 
553
 
void Session::doGetTableIdentifiers(CachedDirectory &,
 
553
void Open_tables_state::doGetTableIdentifiers(CachedDirectory &,
554
554
                                    const SchemaIdentifier &schema_identifier,
555
555
                                    TableIdentifiers &set_of_identifiers)
556
556
{
557
557
  doGetTableIdentifiers(schema_identifier, set_of_identifiers);
558
558
}
559
559
 
560
 
bool Session::doDoesTableExist(const TableIdentifier &identifier)
 
560
bool Open_tables_state::doDoesTableExist(const TableIdentifier &identifier)
561
561
{
562
 
  for (Table *table= temporary_tables ; table ; table= table->getNext())
 
562
  for (Table *table= getTemporaryTables() ; table ; table= table->getNext())
563
563
  {
564
564
    if (table->getShare()->getType() == message::Table::TEMPORARY)
565
565
    {
573
573
  return false;
574
574
}
575
575
 
576
 
int Session::doGetTableDefinition(const TableIdentifier &identifier,
 
576
int Open_tables_state::doGetTableDefinition(const TableIdentifier &identifier,
577
577
                                  message::Table &table_proto)
578
578
{
579
 
  for (Table *table= temporary_tables ; table ; table= table->getNext())
 
579
  for (Table *table= getTemporaryTables() ; table ; table= table->getNext())
580
580
  {
581
581
    if (table->getShare()->getType() == message::Table::TEMPORARY)
582
582
    {
924
924
    TODO -> move this block into a separate function.
925
925
  */
926
926
  bool reset= false;
927
 
  for (table= temporary_tables; table ; table=table->getNext())
 
927
  for (table= getTemporaryTables(); table ; table=table->getNext())
928
928
  {
929
929
    if (table->getShare()->getCacheKey() == key)
930
930
    {