~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/handler.cc

  • Committer: Monty Taylor
  • Date: 2009-04-09 04:53:29 UTC
  • mto: (992.1.1 mordred)
  • mto: This revision was merged to the branch mainline in revision 986.
  • Revision ID: mordred@inaugust.com-20090409045329-p09qjy1cswgm0jme
Removed check for extensions that didn't actually do anything.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
TYPELIB tx_isolation_typelib= {array_elements(tx_isolation_names)-1,"",
64
64
                               tx_isolation_names, NULL};
65
65
 
66
 
static TYPELIB known_extensions= {0,"known_exts", NULL, NULL};
67
 
uint32_t known_extensions_id= 0;
68
 
 
69
66
 
70
67
/**
71
68
  Register handler error messages for use with my_error().
3452
3449
}
3453
3450
 
3454
3451
 
3455
 
/**
3456
 
  Returns a list of all known extensions.
3457
 
 
3458
 
    No mutexes, worst case race is a minor surplus memory allocation
3459
 
    We have to recreate the extension map if mysqld is restarted (for example
3460
 
    within libmysqld)
3461
 
 
3462
 
  @retval
3463
 
    pointer             pointer to TYPELIB structure
3464
 
*/
3465
 
static bool exts_handlerton(Session *,
3466
 
                            st_plugin_int *plugin,
3467
 
                            void *arg)
3468
 
{
3469
 
  List<char> *found_exts= (List<char> *) arg;
3470
 
  StorageEngine *engine= plugin_data(plugin, StorageEngine *);
3471
 
  handler *file;
3472
 
  if (engine->is_enabled() &&
3473
 
      (file= engine->create((TABLE_SHARE*) 0, current_session->mem_root)))
3474
 
  {
3475
 
    List_iterator_fast<char> it(*found_exts);
3476
 
    const char **ext, *old_ext;
3477
 
 
3478
 
    for (ext= file->bas_ext(); *ext; ext++)
3479
 
    {
3480
 
      while ((old_ext= it++))
3481
 
      {
3482
 
        if (!strcmp(old_ext, *ext))
3483
 
          break;
3484
 
      }
3485
 
      if (!old_ext)
3486
 
        found_exts->push_back((char *) *ext);
3487
 
 
3488
 
      it.rewind();
3489
 
    }
3490
 
    delete file;
3491
 
  }
3492
 
  return false;
3493
 
}
3494
 
 
3495
 
TYPELIB *ha_known_exts(void)
3496
 
{
3497
 
  if (!known_extensions.type_names || mysys_usage_id != known_extensions_id)
3498
 
  {
3499
 
    List<char> found_exts;
3500
 
    const char **ext, *old_ext;
3501
 
 
3502
 
    known_extensions_id= mysys_usage_id;
3503
 
 
3504
 
    plugin_foreach(NULL, exts_handlerton,
3505
 
                   DRIZZLE_STORAGE_ENGINE_PLUGIN, &found_exts);
3506
 
 
3507
 
    ext= (const char **) malloc(sizeof(char *)*
3508
 
                                (found_exts.elements+1));
3509
 
                              
3510
 
 
3511
 
    assert(ext != 0);
3512
 
    known_extensions.count= found_exts.elements;
3513
 
    known_extensions.type_names= ext;
3514
 
 
3515
 
    List_iterator_fast<char> it(found_exts);
3516
 
    while ((old_ext= it++))
3517
 
      *ext++= old_ext;
3518
 
    *ext= 0;
3519
 
  }
3520
 
  return &known_extensions;
3521
 
}
3522
 
 
3523
 
 
3524
3452
static bool stat_print(Session *session, const char *type, uint32_t type_len,
3525
3453
                       const char *file, uint32_t file_len,
3526
3454
                       const char *status, uint32_t status_len)