~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

Added code necessary for building plugins dynamically.
Merged in changes from lifeless to allow autoreconf to work.
Touching plugin.ini files now triggers a rebuid - so config/autorun.sh is no
longer required to be run after touching those.
Removed the duplicate plugin names - also removed the issue that getting them
different would silently fail weirdly later.

Show diffs side-by-side

added added

removed removed

Lines of Context:
812
812
    close_temporary_table(table, true, true);
813
813
  else
814
814
  {
815
 
    plugin::StorageEngine *table_type= table->s->db_type();
816
815
    pthread_mutex_lock(&LOCK_open); /* Close and drop a table (AUX routine) */
817
816
    /*
818
817
      unlink_open_table() also tells threads waiting for refresh or close
819
818
      that something has happened.
820
819
    */
821
820
    unlink_open_table(table);
822
 
    quick_rm_table(table_type, db_name, table_name, false);
 
821
    quick_rm_table(*this, db_name, table_name, false);
823
822
    pthread_mutex_unlock(&LOCK_open);
824
823
  }
825
824
}
1321
1320
                                   table_list->db, table_list->table_name,
1322
1321
                                   false);
1323
1322
 
1324
 
      if (plugin::StorageEngine::getTableProto(path, NULL) != EEXIST)
 
1323
      if (plugin::StorageEngine::getTableDefinition(*this, path, table_list->db, table_list->table_name, false) != EEXIST)
1325
1324
      {
1326
1325
        /*
1327
1326
          Table to be created, so we need to create placeholder in table-cache.
2377
2376
  /*
2378
2377
    First open the share, and then open the table from the share we just opened.
2379
2378
  */
2380
 
  if (open_table_def(this, share) ||
 
2379
  if (open_table_def(*this, share) ||
2381
2380
      open_table_from_share(this, share, table_name_arg,
2382
2381
                            (open_mode == OTM_ALTER) ? 0 :
2383
2382
                            (uint32_t) (HA_OPEN_KEYFILE | HA_OPEN_RNDFILE |
4568
4567
                                      "%s%c%s", drizzle_tmpdir, FN_LIBCHAR,
4569
4568
                                      entry->filename.c_str());
4570
4569
 
4571
 
      if (ext_len && !memcmp(".dfe", ext, ext_len))
 
4570
      if (ext_len && !memcmp(drizzled::plugin::DEFAULT_DEFINITION_FILE_EXT.c_str(), ext, ext_len))
4572
4571
      {
4573
4572
        TableShare share;
4574
4573
        /* We should cut file extention before deleting of table */
4575
4574
        memcpy(filePathCopy, filePath, filePath_len - ext_len);
4576
4575
        filePathCopy[filePath_len - ext_len]= 0;
4577
4576
        share.init(NULL, filePathCopy);
4578
 
        if (!open_table_def(session, &share))
 
4577
        if (!open_table_def(*session, &share))
4579
4578
        {
4580
 
          share.db_type()->doDeleteTable(session, filePathCopy);
 
4579
          share.db_type()->doDropTable(*session, filePathCopy);
4581
4580
        }
4582
4581
        share.free_table_share();
4583
4582
      }