~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/haildb/haildb_engine.cc

more license info, logical operators

Show diffs side-by-side

added added

removed removed

Lines of Context:
165
165
 
166
166
  int doCreateTable(Session&,
167
167
                    Table& table_arg,
168
 
                    const drizzled::identifier::Table &identifier,
 
168
                    const drizzled::TableIdentifier &identifier,
169
169
                    drizzled::message::Table& proto);
170
170
 
171
 
  int doDropTable(Session&, const identifier::Table &identifier);
 
171
  int doDropTable(Session&, const TableIdentifier &identifier);
172
172
 
173
173
  int doRenameTable(drizzled::Session&,
174
 
                    const drizzled::identifier::Table&,
175
 
                    const drizzled::identifier::Table&);
 
174
                    const drizzled::TableIdentifier&,
 
175
                    const drizzled::TableIdentifier&);
176
176
 
177
177
  int doGetTableDefinition(Session& session,
178
 
                           const identifier::Table &identifier,
 
178
                           const TableIdentifier &identifier,
179
179
                           drizzled::message::Table &table_proto);
180
180
 
181
 
  bool doDoesTableExist(Session&, const identifier::Table &identifier);
 
181
  bool doDoesTableExist(Session&, const TableIdentifier &identifier);
182
182
 
183
183
private:
184
 
  void getTableNamesInSchemaFromHailDB(const drizzled::identifier::Schema &schema,
 
184
  void getTableNamesInSchemaFromHailDB(const drizzled::SchemaIdentifier &schema,
185
185
                                       drizzled::plugin::TableNameList *set_of_names,
186
 
                                       drizzled::identifier::Table::vector *identifiers);
 
186
                                       drizzled::TableIdentifier::vector *identifiers);
187
187
 
188
188
public:
189
189
  void doGetTableIdentifiers(drizzled::CachedDirectory &,
190
 
                             const drizzled::identifier::Schema &schema,
191
 
                             drizzled::identifier::Table::vector &identifiers);
 
190
                             const drizzled::SchemaIdentifier &schema,
 
191
                             drizzled::TableIdentifier::vector &identifiers);
192
192
 
193
193
  /* The following defines can be increased if necessary */
194
194
  uint32_t max_supported_keys()          const { return 1000; }
791
791
  return &name[l];
792
792
}
793
793
 
794
 
static void TableIdentifier_to_haildb_name(const identifier::Table &identifier, std::string *str)
 
794
static void TableIdentifier_to_haildb_name(const TableIdentifier &identifier, std::string *str)
795
795
{
796
796
  str->assign(table_path_to_haildb_name(identifier.getPath().c_str()));
797
797
}
1026
1026
 
1027
1027
int HailDBEngine::doCreateTable(Session &session,
1028
1028
                                        Table& table_obj,
1029
 
                                        const drizzled::identifier::Table &identifier,
 
1029
                                        const drizzled::TableIdentifier &identifier,
1030
1030
                                        drizzled::message::Table& table_message)
1031
1031
{
1032
1032
  ib_tbl_sch_t haildb_table_schema= NULL;
1282
1282
}
1283
1283
 
1284
1284
int HailDBEngine::doDropTable(Session &session,
1285
 
                                      const identifier::Table &identifier)
 
1285
                                      const TableIdentifier &identifier)
1286
1286
{
1287
1287
  ib_trx_t haildb_schema_transaction;
1288
1288
  ib_err_t haildb_err;
1364
1364
  return 0;
1365
1365
}
1366
1366
 
1367
 
static ib_err_t rename_table_message(ib_trx_t transaction, const identifier::Table &from_identifier, const identifier::Table &to_identifier)
 
1367
static ib_err_t rename_table_message(ib_trx_t transaction, const TableIdentifier &from_identifier, const TableIdentifier &to_identifier)
1368
1368
{
1369
1369
  ib_crsr_t cursor;
1370
1370
  ib_tpl_t search_tuple;
1455
1455
}
1456
1456
 
1457
1457
int HailDBEngine::doRenameTable(drizzled::Session &session,
1458
 
                                        const drizzled::identifier::Table &from,
1459
 
                                        const drizzled::identifier::Table &to)
 
1458
                                        const drizzled::TableIdentifier &from,
 
1459
                                        const drizzled::TableIdentifier &to)
1460
1460
{
1461
1461
  ib_trx_t haildb_schema_transaction;
1462
1462
  ib_err_t err;
1510
1510
}
1511
1511
 
1512
1512
void HailDBEngine::getTableNamesInSchemaFromHailDB(
1513
 
                                 const drizzled::identifier::Schema &schema,
 
1513
                                 const drizzled::SchemaIdentifier &schema,
1514
1514
                                 drizzled::plugin::TableNameList *set_of_names,
1515
 
                                 drizzled::identifier::Table::vector *identifiers)
 
1515
                                 drizzled::TableIdentifier::vector *identifiers)
1516
1516
{
1517
1517
  ib_trx_t   transaction;
1518
1518
  ib_crsr_t  cursor;
1542
1542
    {
1543
1543
      BOOST_FOREACH(std::string table_name, haildb_system_table_names)
1544
1544
      {
1545
 
        identifiers->push_back(identifier::Table(schema.getSchemaName(),
 
1545
        identifiers->push_back(TableIdentifier(schema.getSchemaName(),
1546
1546
                                               table_name));
1547
1547
      }
1548
1548
    }
1585
1585
      if (set_of_names)
1586
1586
        set_of_names->insert(just_table_name);
1587
1587
      if (identifiers)
1588
 
        identifiers->push_back(identifier::Table(schema.getSchemaName(), just_table_name));
 
1588
        identifiers->push_back(TableIdentifier(schema.getSchemaName(), just_table_name));
1589
1589
    }
1590
1590
 
1591
1591
 
1604
1604
}
1605
1605
 
1606
1606
void HailDBEngine::doGetTableIdentifiers(drizzled::CachedDirectory &,
1607
 
                                                 const drizzled::identifier::Schema &schema,
1608
 
                                                 drizzled::identifier::Table::vector &identifiers)
 
1607
                                                 const drizzled::SchemaIdentifier &schema,
 
1608
                                                 drizzled::TableIdentifier::vector &identifiers)
1609
1609
{
1610
1610
  getTableNamesInSchemaFromHailDB(schema, NULL, &identifiers);
1611
1611
}
1730
1730
}
1731
1731
 
1732
1732
int HailDBEngine::doGetTableDefinition(Session &session,
1733
 
                                               const identifier::Table &identifier,
 
1733
                                               const TableIdentifier &identifier,
1734
1734
                                               drizzled::message::Table &table)
1735
1735
{
1736
1736
  ib_crsr_t haildb_cursor= NULL;
1759
1759
}
1760
1760
 
1761
1761
bool HailDBEngine::doDoesTableExist(Session &,
1762
 
                                    const identifier::Table& identifier)
 
1762
                                    const TableIdentifier& identifier)
1763
1763
{
1764
1764
  ib_crsr_t haildb_cursor;
1765
1765
  string haildb_table_name;