~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/handler/ha_innodb.cc

  • Committer: Brian Aker
  • Date: 2011-01-17 23:44:48 UTC
  • mfrom: (2088.1.5 drizzle-build)
  • Revision ID: brian@tangent.org-20110117234448-0tt6rd6fxa3csdaf
Rollup of all changes for identifier/error

Show diffs side-by-side

added added

removed removed

Lines of Context:
446
446
  doDropSchema(
447
447
  /*===================*/
448
448
        /* out: error number */
449
 
    const SchemaIdentifier  &identifier); /* in: database path; inside InnoDB the name
 
449
    const identifier::Schema  &identifier); /* in: database path; inside InnoDB the name
450
450
        of the last directory in the path is used as
451
451
        the database name: for example, in 'mysql/data/test'
452
452
        the database name is 'test' */
485
485
 
486
486
  UNIV_INTERN int doCreateTable(Session &session,
487
487
                                Table &form,
488
 
                                const TableIdentifier &identifier,
 
488
                                const identifier::Table &identifier,
489
489
                                message::Table&);
490
 
  UNIV_INTERN int doRenameTable(Session&, const TableIdentifier &from, const TableIdentifier &to);
491
 
  UNIV_INTERN int doDropTable(Session &session, const TableIdentifier &identifier);
 
490
  UNIV_INTERN int doRenameTable(Session&, const identifier::Table &from, const identifier::Table &to);
 
491
  UNIV_INTERN int doDropTable(Session &session, const identifier::Table &identifier);
492
492
 
493
493
  UNIV_INTERN virtual bool get_error_message(int error, String *buf);
494
494
 
507
507
  }
508
508
 
509
509
  int doGetTableDefinition(drizzled::Session& session,
510
 
                           const TableIdentifier &identifier,
 
510
                           const identifier::Table &identifier,
511
511
                           drizzled::message::Table &table_proto);
512
512
 
513
 
  bool doDoesTableExist(drizzled::Session& session, const TableIdentifier &identifier);
 
513
  bool doDoesTableExist(drizzled::Session& session, const identifier::Table &identifier);
514
514
 
515
515
  void doGetTableIdentifiers(drizzled::CachedDirectory &directory,
516
 
                             const drizzled::SchemaIdentifier &schema_identifier,
517
 
                             drizzled::TableIdentifier::vector &set_of_identifiers);
 
516
                             const drizzled::identifier::Schema &schema_identifier,
 
517
                             drizzled::identifier::Table::vector &set_of_identifiers);
518
518
  bool validateCreateTableOption(const std::string &key, const std::string &state);
519
519
  void dropTemporarySchema();
520
520
 
542
542
}
543
543
 
544
544
void InnobaseEngine::doGetTableIdentifiers(drizzled::CachedDirectory &directory,
545
 
                                           const drizzled::SchemaIdentifier &schema_identifier,
546
 
                                           drizzled::TableIdentifier::vector &set_of_identifiers)
 
545
                                           const drizzled::identifier::Schema &schema_identifier,
 
546
                                           drizzled::identifier::Table::vector &set_of_identifiers)
547
547
{
548
548
  CachedDirectory::Entries entries= directory.getEntries();
549
549
 
574
574
           Using schema_identifier here to stop unused warning, could use
575
575
           definition.schema() instead
576
576
        */
577
 
        TableIdentifier identifier(schema_identifier.getSchemaName(), definition.name());
 
577
        identifier::Table identifier(schema_identifier.getSchemaName(), definition.name());
578
578
        set_of_identifiers.push_back(identifier);
579
579
      }
580
580
    }
581
581
  }
582
582
}
583
583
 
584
 
bool InnobaseEngine::doDoesTableExist(Session &session, const TableIdentifier &identifier)
 
584
bool InnobaseEngine::doDoesTableExist(Session &session, const identifier::Table &identifier)
585
585
{
586
586
  string proto_path(identifier.getPath());
587
587
  proto_path.append(DEFAULT_FILE_EXTENSION);
598
598
}
599
599
 
600
600
int InnobaseEngine::doGetTableDefinition(Session &session,
601
 
                                         const TableIdentifier &identifier,
 
601
                                         const identifier::Table &identifier,
602
602
                                         message::Table &table_proto)
603
603
{
604
604
  string proto_path(identifier.getPath());
1692
1692
    nz[idlen] = 0;
1693
1693
 
1694
1694
    s = nz2.get();
1695
 
    idlen = TableIdentifier::filename_to_tablename(nz, nz2.get(), nz2_size);
 
1695
    idlen = identifier::Table::filename_to_tablename(nz, nz2.get(), nz2_size);
1696
1696
  }
1697
1697
 
1698
1698
  /* See if the identifier needs to be quoted. */
3347
3347
@return 1 if error, 0 if success */
3348
3348
UNIV_INTERN
3349
3349
int
3350
 
ha_innobase::doOpen(const TableIdentifier &identifier,
 
3350
ha_innobase::doOpen(const identifier::Table &identifier,
3351
3351
                    int   mode,   /*!< in: not used */
3352
3352
                    uint    test_if_locked) /*!< in: not used */
3353
3353
{
6118
6118
/*================*/
6119
6119
  Session         &session, /*!< in: Session */
6120
6120
  Table&    form,   /*!< in: information on table columns and indexes */
6121
 
        const TableIdentifier &identifier,
 
6121
        const identifier::Table &identifier,
6122
6122
        message::Table& create_proto)
6123
6123
{
6124
6124
  int   error;
6519
6519
InnobaseEngine::doDropTable(
6520
6520
/*======================*/
6521
6521
        Session &session,
6522
 
        const TableIdentifier &identifier)
 
6522
        const identifier::Table &identifier)
6523
6523
{
6524
6524
  int error;
6525
6525
  trx_t*  parent_trx;
6610
6610
bool
6611
6611
InnobaseEngine::doDropSchema(
6612
6612
/*===================*/
6613
 
                             const SchemaIdentifier &identifier)
 
6613
                             const identifier::Schema &identifier)
6614
6614
    /*!< in: database path; inside InnoDB the name
6615
6615
      of the last directory in the path is used as
6616
6616
      the database name: for example, in 'mysql/data/test'
6660
6660
 
6661
6661
void InnobaseEngine::dropTemporarySchema()
6662
6662
{
6663
 
  SchemaIdentifier schema_identifier(GLOBAL_TEMPORARY_EXT);
 
6663
  identifier::Schema schema_identifier(GLOBAL_TEMPORARY_EXT);
6664
6664
  trx_t*  trx= NULL;
6665
6665
  string schema_path(GLOBAL_TEMPORARY_EXT);
6666
6666
 
6746
6746
/*********************************************************************//**
6747
6747
Renames an InnoDB table.
6748
6748
@return 0 or error code */
6749
 
UNIV_INTERN int InnobaseEngine::doRenameTable(Session &session, const TableIdentifier &from, const TableIdentifier &to)
 
6749
UNIV_INTERN int InnobaseEngine::doRenameTable(Session &session, const identifier::Table &from, const identifier::Table &to)
6750
6750
{
6751
6751
  // A temp table alter table/rename is a shallow rename and only the
6752
6752
  // definition needs to be updated.
7771
7771
      i++;
7772
7772
    }
7773
7773
    db_name[i] = 0;
7774
 
    ulen= TableIdentifier::filename_to_tablename(db_name, uname, sizeof(uname));
 
7774
    ulen= identifier::Table::filename_to_tablename(db_name, uname, sizeof(uname));
7775
7775
    LEX_STRING *tmp_referenced_db = session->make_lex_string(NULL, uname, ulen, true);
7776
7776
 
7777
7777
    /* Table name */
7778
7778
    tmp_buff += i + 1;
7779
 
    ulen= TableIdentifier::filename_to_tablename(tmp_buff, uname, sizeof(uname));
 
7779
    ulen= identifier::Table::filename_to_tablename(tmp_buff, uname, sizeof(uname));
7780
7780
    LEX_STRING *tmp_referenced_table = session->make_lex_string(NULL, uname, ulen, true);
7781
7781
 
7782
7782
    /** Foreign Fields **/