~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_share.cc

  • Committer: Brian Aker
  • Date: 2010-06-16 17:29:00 UTC
  • mto: This revision was merged to the branch mainline in revision 1625.
  • Revision ID: brian@gaz-20100616172900-fzv6n6nrtyhhny7x
Update for TableShare usage of key (remove a case where we had to build it). 

Show diffs side-by-side

added added

removed removed

Lines of Context:
591
591
  assert(identifier.getKey() == key);
592
592
 
593
593
  table_charset= 0;
594
 
  memset(&db, 0, sizeof(LEX_STRING));
595
 
  memset(&table_name, 0, sizeof(LEX_STRING));
596
594
  memset(&path, 0, sizeof(LEX_STRING));
597
595
  memset(&normalized_path, 0, sizeof(LEX_STRING));
598
596
 
825
823
  path.length= normalized_path.length= strlen(new_path);
826
824
}
827
825
 
 
826
TableShare::~TableShare() 
 
827
{
 
828
  assert(ref_count == 0);
 
829
 
 
830
  /*
 
831
    If someone is waiting for this to be deleted, inform it about this.
 
832
    Don't do a delete until we know that no one is refering to this anymore.
 
833
  */
 
834
  if (tmp_table == message::Table::STANDARD)
 
835
  {
 
836
    /* share->mutex is locked in release_table_share() */
 
837
    while (waiting_on_cond)
 
838
    {
 
839
      pthread_cond_broadcast(&cond);
 
840
      pthread_cond_wait(&cond, &mutex);
 
841
    }
 
842
    /* No thread refers to this anymore */
 
843
    pthread_mutex_unlock(&mutex);
 
844
    pthread_mutex_destroy(&mutex);
 
845
    pthread_cond_destroy(&cond);
 
846
  }
 
847
  hash_free(&name_hash);
 
848
 
 
849
  storage_engine= NULL;
 
850
 
 
851
  delete table_proto;
 
852
  table_proto= NULL;
 
853
 
 
854
  mem_root.free_root(MYF(0));                 // Free's share
 
855
}
 
856
 
828
857
void TableShare::setIdentifier(TableIdentifier &identifier_arg)
829
858
{
830
859
  private_key_for_cache.clear();