~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/tableprototester/tableprototester.cc

  • Committer: Brian Aker
  • Date: 2010-09-11 01:35:47 UTC
  • mto: (1759.2.1 build)
  • mto: This revision was merged to the branch mainline in revision 1762.
  • Revision ID: brian@tangent.org-20100911013547-b04k7f1qddr3ml4t
Shuffle native functions over to hash such that we have a specific container
for them.

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