~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/tableprototester/tableprototester.cc

Lowercase plugin name prefix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
    table_definition_ext= TABLEPROTOTESTER_EXT;
58
58
  }
59
59
 
60
 
  virtual Cursor *create(Table &table)
 
60
  virtual Cursor *create(TableShare &table,
 
61
                         drizzled::memory::Root *mem_root)
61
62
  {
62
 
    return new TableProtoTesterCursor(*this, table);
 
63
    return new (mem_root) TableProtoTesterCursor(*this, table);
63
64
  }
64
65
 
65
66
  const char **bas_ext() const {
77
78
                           const drizzled::TableIdentifier &identifier,
78
79
                           drizzled::message::Table &table_proto);
79
80
 
 
81
  void doGetTableNames(drizzled::CachedDirectory &directory,
 
82
                       const SchemaIdentifier &,
 
83
                       set<string>& set_of_names)
 
84
  {
 
85
    (void)directory;
 
86
    set_of_names.insert("t1");
 
87
 
 
88
  }
 
89
 
80
90
  /* The following defines can be increased if necessary */
81
91
  uint32_t max_supported_keys()          const { return 64; }
82
92
  uint32_t max_supported_key_length()    const { return 1000; }
100
110
 
101
111
  void doGetTableIdentifiers(drizzled::CachedDirectory &directory,
102
112
                             const drizzled::SchemaIdentifier &schema_identifier,
103
 
                             drizzled::TableIdentifier::vector &set_of_identifiers);
 
113
                             drizzled::TableIdentifiers &set_of_identifiers);
104
114
};
105
115
 
106
116
void TableProtoTesterEngine::doGetTableIdentifiers(drizzled::CachedDirectory&,
107
117
                                                   const drizzled::SchemaIdentifier &schema_identifier,
108
 
                                                   drizzled::TableIdentifier::vector &set_of_identifiers)
 
118
                                                   drizzled::TableIdentifiers &set_of_identifiers)
109
119
{
110
120
  if (schema_identifier.compare("test"))
111
121
  {
117
127
 
118
128
bool TableProtoTesterEngine::doDoesTableExist(Session&, const drizzled::TableIdentifier &identifier)
119
129
{
120
 
  if (not identifier.getPath().compare("test/t1"))
121
 
    return true;
122
 
  if (not identifier.getPath().compare("test/too_many_enum_values"))
123
 
    return true;
124
 
  if (not identifier.getPath().compare("test/invalid_table_collation"))
 
130
  if (not identifier.getPath().compare("./test/t1"))
 
131
    return true;
 
132
  if (not identifier.getPath().compare("./test/too_many_enum_values"))
 
133
    return true;
 
134
  if (not identifier.getPath().compare("./test/invalid_table_collation"))
125
135
    return true;
126
136
 
127
137
  return false;
128
138
}
129
139
 
130
140
TableProtoTesterCursor::TableProtoTesterCursor(drizzled::plugin::StorageEngine &engine_arg,
131
 
                                               Table &table_arg) :
 
141
                           TableShare &table_arg) :
132
142
  Cursor(engine_arg, table_arg)
133
143
{ }
134
144
 
238
248
                                                 const drizzled::TableIdentifier &identifier,
239
249
                                                 drizzled::message::Table &table_proto)
240
250
{
241
 
  if (not identifier.getPath().compare("test/t1"))
 
251
  if (not identifier.getPath().compare("./test/t1"))
242
252
  {
243
253
    fill_table1(table_proto);
244
254
    return EEXIST;
245
255
  }
246
 
  else if (not identifier.getPath().compare("test/too_many_enum_values"))
 
256
  else if (not identifier.getPath().compare("./test/too_many_enum_values"))
247
257
  {
248
258
    fill_table_too_many_enum_values(table_proto);
249
259
    return EEXIST;
250
260
  }
251
 
  else if (not identifier.getPath().compare("test/invalid_table_collation"))
 
261
  else if (not identifier.getPath().compare("./test/invalid_table_collation"))
252
262
  {
253
263
    fill_table_invalid_table_collation(table_proto);
254
264
    return EEXIST;
263
273
 
264
274
int TableProtoTesterCursor::doInsertRecord(unsigned char *)
265
275
{
266
 
  return(getTable()->next_number_field ? update_auto_increment() : 0);
 
276
  return(table->next_number_field ? update_auto_increment() : 0);
267
277
}
268
278
 
269
279
int TableProtoTesterCursor::doStartTableScan(bool)