~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/blackhole/ha_blackhole.cc

  • Committer: Brian Aker
  • Date: 2009-12-01 02:39:03 UTC
  • mfrom: (1234.1.4 push)
  • Revision ID: brian@gaz-20091201023903-1id5z7xnup695jaq
Merge of Brian + Jay test fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
{
42
42
public:
43
43
  BlackholeEngine(const string &name_arg)
44
 
   : drizzled::plugin::StorageEngine(name_arg, HTON_FILE_BASED | HTON_HAS_DATA_DICTIONARY) 
 
44
   : drizzled::plugin::StorageEngine(name_arg, HTON_FILE_BASED |
 
45
                                     HTON_NULL_IN_KEY |
 
46
                                     HTON_CAN_INDEX_BLOBS |
 
47
                                     HTON_AUTO_PART_KEY |
 
48
                                     HTON_HAS_DATA_DICTIONARY)
45
49
  {
46
50
    table_definition_ext= BLACKHOLE_EXT;
47
51
  }
48
52
 
49
 
  uint64_t table_flags() const
50
 
  {
51
 
    return(HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY);
52
 
  }
53
 
 
54
53
  virtual Cursor *create(TableShare &table,
55
54
                          MEM_ROOT *mem_root)
56
55
  {
61
60
    return ha_blackhole_exts;
62
61
  }
63
62
 
64
 
  int doCreateTable(Session*, 
 
63
  int doCreateTable(Session*,
65
64
                    const char *,
66
65
                    Table&,
67
66
                    drizzled::message::Table&);
68
67
 
69
 
  int doDropTable(Session&, const string table_name); 
 
68
  int doDropTable(Session&, const string table_name);
70
69
 
71
70
  int doGetTableDefinition(Session& session,
72
71
                           const char* path,
79
78
  {
80
79
    CachedDirectory::Entries entries= directory.getEntries();
81
80
 
82
 
    for (CachedDirectory::Entries::iterator entry_iter= entries.begin(); 
 
81
    for (CachedDirectory::Entries::iterator entry_iter= entries.begin();
83
82
         entry_iter != entries.end(); ++entry_iter)
84
83
    {
85
84
      CachedDirectory::Entry *entry= *entry_iter;
99
98
 
100
99
        file_name_len= filename_to_tablename(filename->c_str(), uname, sizeof(uname));
101
100
        // TODO: Remove need for memory copy here
102
 
        uname[file_name_len - sizeof(BLACKHOLE_EXT) + 1]= '\0'; // Subtract ending, place NULL 
 
101
        uname[file_name_len - sizeof(BLACKHOLE_EXT) + 1]= '\0'; // Subtract ending, place NULL
103
102
        set_of_names.insert(uname);
104
103
      }
105
104
    }
106
105
  }
 
106
 
 
107
  /* The following defines can be increased if necessary */
 
108
  uint32_t max_supported_keys()          const { return BLACKHOLE_MAX_KEY; }
 
109
  uint32_t max_supported_key_length()    const { return BLACKHOLE_MAX_KEY_LENGTH; }
 
110
  uint32_t max_supported_key_part_length() const { return BLACKHOLE_MAX_KEY_LENGTH; }
107
111
};
108
112
 
109
113
/* Static declarations for shared structures */