~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_share.cc

  • Committer: Siddharth Prakash Singh
  • Date: 2010-03-26 19:25:23 UTC
  • mfrom: (1410 drizzle)
  • mto: This revision was merged to the branch mainline in revision 1425.
  • Revision ID: spsneo@spsneo-laptop-20100326192523-ibjlbt1p692vobtj
merging with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
203
203
    return foundTableShare(share);
204
204
  }
205
205
 
206
 
  if (!(share= alloc_table_share(table_list, key, key_length)))
 
206
  if (not (share= alloc_table_share(table_list, key, key_length)))
207
207
  {
208
208
    return NULL;
209
209
  }
225
225
    return NULL;
226
226
  }
227
227
  
228
 
  if (open_table_def(*session, share))
 
228
  TableIdentifier identifier(share->getSchemaName(), share->getTableName());
 
229
  if (open_table_def(*session, identifier, share))
229
230
  {
230
231
    *error= share->error;
231
232
    table_def_cache.erase(key_string);
234
235
  }
235
236
  share->ref_count++;                           // Mark in use
236
237
  (void) pthread_mutex_unlock(&share->mutex);
 
238
 
237
239
  return share;
238
 
 
239
240
}
240
241
 
241
242
 
253
254
*/
254
255
TableShare *TableShare::getShare(TableIdentifier &identifier)
255
256
{
256
 
  return TableShare::getShare(identifier.getSchemaName().c_str(), identifier.getTableName().c_str());
257
 
}
258
 
 
259
 
TableShare *TableShare::getShare(const char *db, const char *table_name)
260
 
{
261
 
  char key[NAME_LEN*2+2];
 
257
  char key[MAX_DBKEY_LENGTH];
262
258
  uint32_t key_length;
263
259
  safe_mutex_assert_owner(&LOCK_open);
264
260
 
265
 
  key_length= TableShare::createKey(key, db, table_name);
 
261
  key_length= TableShare::createKey(key, identifier);
266
262
 
267
263
  const string key_string(key, key_length);
 
264
 
268
265
  TableDefinitionCache::iterator iter= table_def_cache.find(key_string);
269
266
  if (iter != table_def_cache.end())
270
267
  {