~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

  • Committer: Brian Aker
  • Date: 2010-02-25 07:54:52 UTC
  • mfrom: (1273.13.101 build)
  • Revision ID: brian@gaz-20100225075452-19eozreshbrerypu
Merge of all patches in build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
661
661
}
662
662
 
663
663
 
 
664
void Session::doGetTableNames(CachedDirectory &,
 
665
                              const std::string& db_name,
 
666
                              std::set<std::string>& set_of_names)
 
667
{
 
668
  for (Table *table= temporary_tables ; table ; table= table->next)
 
669
  {
 
670
    if (not db_name.compare(table->s->db.str))
 
671
    {
 
672
      set_of_names.insert(table->s->table_name.str);
 
673
    }
 
674
  }
 
675
}
 
676
 
 
677
int Session::doGetTableDefinition(const char *,
 
678
                                  const char *db_arg,
 
679
                                  const char *table_name_arg,
 
680
                                  const bool ,
 
681
                                  message::Table *table_proto)
 
682
{
 
683
  for (Table *table= temporary_tables ; table ; table= table->next)
 
684
  {
 
685
    if (table->s->tmp_table == TEMP_TABLE)
 
686
    {
 
687
      if (not strcmp(db_arg, table->s->db.str))
 
688
      {
 
689
        if (not strcmp(table_name_arg, table->s->table_name.str))
 
690
        {
 
691
          if (table_proto)
 
692
            table_proto->CopyFrom(*(table->s->getTableProto()));
 
693
 
 
694
          return EEXIST;
 
695
        }
 
696
      }
 
697
    }
 
698
  }
 
699
 
 
700
  return ENOENT;
 
701
}
 
702
 
664
703
Table *Session::find_temporary_table(const char *new_db, const char *table_name)
665
704
{
666
705
  char  key[MAX_DBKEY_LENGTH];
4145
4184
    return false;
4146
4185
 
4147
4186
  /*
4148
 
TODO: in the case when we skipped all columns because there was a
4149
 
qualified '*', and all columns were coalesced, we have to give a more
4150
 
meaningful message than ER_BAD_TABLE_ERROR.
 
4187
    @TODO in the case when we skipped all columns because there was a
 
4188
    qualified '*', and all columns were coalesced, we have to give a more
 
4189
    meaningful message than ER_BAD_TABLE_ERROR.
4151
4190
  */
4152
4191
  if (!table_name)
4153
4192
    my_message(ER_NO_TABLES_USED, ER(ER_NO_TABLES_USED), MYF(0));