drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
InnobaseEngine Class Reference
Inheritance diagram for InnobaseEngine:
[legend]
Collaboration diagram for InnobaseEngine:
[legend]

Public Member Functions

 InnobaseEngine (string name_arg)
virtual int close_connection (Session *session)
virtual int doSetSavepoint (Session *session, drizzled::NamedSavepoint &savepoint)
virtual int doRollbackToSavepoint (Session *session, drizzled::NamedSavepoint &savepoint)
virtual int doReleaseSavepoint (Session *session, drizzled::NamedSavepoint &savepoint)
virtual int doXaCommit (Session *session, bool all)
virtual int doXaRollback (Session *session, bool all)
virtual uint64_t doGetCurrentTransactionId (Session *session)
virtual uint64_t doGetNewTransactionId (Session *session)
virtual int doCommit (Session *session, bool all)
virtual int doRollback (Session *session, bool all)
virtual int doXaPrepare (Session *session, bool all)
virtual int doXaRecover (::drizzled::XID *xid_list, size_t len)
virtual int doXaCommitXid (::drizzled::XID *xid)
virtual int doXaRollbackXid (::drizzled::XID *xid)
virtual Cursor * create (Table &table)
bool doDropSchema (const identifier::Schema &identifier)
virtual bool flush_logs ()
virtual bool show_status (Session *session, stat_print_fn *stat_print, enum ha_stat_type stat_type)
virtual int doReleaseTemporaryLatches (Session *session)
const char ** bas_ext () const
UNIV_INTERN int doCreateTable (Session &session, Table &form, const identifier::Table &identifier, const message::Table &)
UNIV_INTERN int doRenameTable (Session &, const identifier::Table &from, const identifier::Table &to)
UNIV_INTERN int doDropTable (Session &session, const identifier::Table &identifier)
virtual UNIV_INTERN bool get_error_message (int error, String *buf) const
UNIV_INTERN uint32_t max_supported_keys () const
UNIV_INTERN uint32_t max_supported_key_length () const
UNIV_INTERN uint32_t max_supported_key_part_length () const
UNIV_INTERN uint32_t index_flags (drizzled::message::Table::Index::IndexType) const
int doGetTableDefinition (drizzled::Session &session, const identifier::Table &identifier, drizzled::message::Table &table_proto)
bool doDoesTableExist (drizzled::Session &session, const identifier::Table &identifier)
void doGetTableIdentifiers (drizzled::CachedDirectory &directory, const drizzled::identifier::Schema &schema_identifier, drizzled::identifier::table::vector &set_of_identifiers)
bool validateCreateTableOption (const std::string &key, const std::string &state)
void dropTemporarySchema ()

Private Member Functions

virtual int doStartTransaction (Session *session, start_transaction_option_t options)
virtual void doStartStatement (Session *session)
virtual void doEndStatement (Session *session)

Detailed Description

Definition at line 386 of file ha_innodb.cc.

Constructor & Destructor Documentation

◆ InnobaseEngine()

InnobaseEngine::InnobaseEngine ( string name_arg)
inlineexplicit

Definition at line 389 of file ha_innodb.cc.

◆ ~InnobaseEngine()

virtual InnobaseEngine::~InnobaseEngine ( )
inlinevirtual

Definition at line 402 of file ha_innodb.cc.

Member Function Documentation

◆ bas_ext()

const char ** InnobaseEngine::bas_ext ( ) const
inline

Definition at line 536 of file ha_innodb.cc.

◆ close_connection()

int InnobaseEngine::close_connection ( Session * session)
virtual

Frees a possible InnoDB trx object associated with the current Session.

Returns
0 or error number
Parameters
sessionin: handle to the MySQL thread of the user whose resources should be free'd

Definition at line 3082 of file ha_innodb.cc.

◆ create()

virtual Cursor * InnobaseEngine::create ( Table & table)
inlinevirtual

Definition at line 492 of file ha_innodb.cc.

◆ doCommit()

int InnobaseEngine::doCommit ( Session * session,
bool all )
virtual

Commits a transaction in an InnoDB database or marks an SQL statement ended.

Returns
0
Parameters
sessionin: MySQL thread handle of the user for whom the transaction should be committed
allin: TRUE - commit transaction FALSE - the current SQL statement ended

Definition at line 2800 of file ha_innodb.cc.

◆ doCreateTable()

UNIV_INTERN int InnobaseEngine::doCreateTable ( Session & session,
Table & form,
const identifier::Table & identifier,
const message::Table & create_proto )

Validates the create options. We may build on this function in future. For now, it checks two specifiers: KEY_BLOCK_SIZE and ROW_FORMAT If innodb_strict_mode is not set then this function is a no-op

Returns
TRUE if valid.
Parameters
sessionin: Session
formin: information on table columns and indexes

Definition at line 6323 of file ha_innodb.cc.

◆ doDoesTableExist()

bool InnobaseEngine::doDoesTableExist ( drizzled::Session & session,
const identifier::Table & identifier )

Definition at line 650 of file ha_innodb.cc.

◆ doDropSchema()

bool InnobaseEngine::doDropSchema ( const identifier::Schema & identifier)

Removes all tables in the named database inside InnoDB.

Parameters
identifierin: database path; inside InnoDB the name of the last directory in the path is used as the database name: for example, in 'mysql/data/test' the database name is 'test'

Definition at line 6830 of file ha_innodb.cc.

◆ doDropTable()

UNIV_INTERN int InnobaseEngine::doDropTable ( Session & session,
const identifier::Table & identifier )

Drops a table from an InnoDB database. Before calling this function, MySQL calls innobase_commit to commit the transaction of the current user. Then the current user cannot have locks set on the table. Drop table operation inside InnoDB will remove all locks any user has on the table inside InnoDB.

Returns
error number

Definition at line 6725 of file ha_innodb.cc.

◆ doEndStatement()

void InnobaseEngine::doEndStatement ( Session * session)
privatevirtual

Definition at line 9197 of file ha_innodb.cc.

◆ doGetCurrentTransactionId()

uint64_t InnobaseEngine::doGetCurrentTransactionId ( Session * session)
virtual

Definition at line 9277 of file ha_innodb.cc.

◆ doGetNewTransactionId()

uint64_t InnobaseEngine::doGetNewTransactionId ( Session * session)
virtual

Definition at line 9283 of file ha_innodb.cc.

◆ doGetTableDefinition()

int InnobaseEngine::doGetTableDefinition ( drizzled::Session & session,
const identifier::Table & identifier,
drizzled::message::Table & table_proto )

Definition at line 672 of file ha_innodb.cc.

◆ doGetTableIdentifiers()

void InnobaseEngine::doGetTableIdentifiers ( drizzled::CachedDirectory & directory,
const drizzled::identifier::Schema & schema_identifier,
drizzled::identifier::table::vector & set_of_identifiers )

Definition at line 598 of file ha_innodb.cc.

◆ doReleaseSavepoint()

int InnobaseEngine::doReleaseSavepoint ( Session * session,
drizzled::NamedSavepoint & named_savepoint )
virtual

Release transaction savepoint name.

Returns
0 if success, HA_ERR_NO_SAVEPOINT if no savepoint with the given name
Parameters
sessionin: handle to the MySQL thread of the user whose transaction should be rolled back
named_savepointin: savepoint data

Definition at line 3024 of file ha_innodb.cc.

◆ doReleaseTemporaryLatches()

int InnobaseEngine::doReleaseTemporaryLatches ( Session * session)
virtual

Call this function when mysqld passes control to the client. That is to avoid deadlocks on the adaptive hash S-latch possibly held by session. For more documentation, see Cursor.cc.

Returns
0
Parameters
sessionin: MySQL thread

Definition at line 1073 of file ha_innodb.cc.

◆ doRenameTable()

UNIV_INTERN int InnobaseEngine::doRenameTable ( Session & session,
const identifier::Table & from,
const identifier::Table & to )

Renames an InnoDB table.

Returns
0 or error code

Definition at line 6963 of file ha_innodb.cc.

◆ doRollback()

int InnobaseEngine::doRollback ( Session * session,
bool all )
virtual

Rolls back a transaction or the latest SQL statement.

Returns
0 or error number
Parameters
sessionin: handle to the MySQL thread of the user whose transaction should be rolled back
allin: TRUE - commit transaction FALSE - the current SQL statement ended

Definition at line 2915 of file ha_innodb.cc.

◆ doRollbackToSavepoint()

int InnobaseEngine::doRollbackToSavepoint ( Session * session,
drizzled::NamedSavepoint & named_savepoint )
virtual

Rolls back a transaction to a savepoint.

Returns
0 if success, HA_ERR_NO_SAVEPOINT if no savepoint with the given name
Parameters
sessionin: handle to the MySQL thread of the user whose transaction should be rolled back
named_savepointin: savepoint data

Definition at line 2994 of file ha_innodb.cc.

◆ doSetSavepoint()

int InnobaseEngine::doSetSavepoint ( Session * session,
drizzled::NamedSavepoint & named_savepoint )
virtual

Sets a transaction savepoint.

Returns
always 0, that is, always succeeds
Parameters
sessionin: handle to the MySQL thread
named_savepointin: savepoint data

Definition at line 3046 of file ha_innodb.cc.

◆ doStartStatement()

void InnobaseEngine::doStartStatement ( Session * session)
privatevirtual

We will also use this function to communicate to InnoDB that a new SQL statement has started and that we must store a savepoint to our transaction handle, so that we are able to roll back the SQL statement in case of an error.

Parameters
sessionin: handle to the Drizzle session

Definition at line 9180 of file ha_innodb.cc.

◆ doStartTransaction()

int InnobaseEngine::doStartTransaction ( Session * session,
start_transaction_option_t options )
privatevirtual

Creates an InnoDB transaction struct for the thd if it does not yet have one. Starts a new InnoDB transaction if a transaction is not yet started. And assigns a new snapshot for a consistent read if the transaction does not yet have one.

Returns
0
Parameters
sessionin: MySQL thread handle of the user for whom the transaction should be committed

Definition at line 2769 of file ha_innodb.cc.

◆ doXaCommit()

virtual int InnobaseEngine::doXaCommit ( Session * session,
bool all )
inlinevirtual

Definition at line 439 of file ha_innodb.cc.

◆ doXaCommitXid()

int InnobaseEngine::doXaCommitXid ( ::drizzled::XID * xid)
virtual

This function is used to commit one X/Open XA distributed transaction which is in the prepared state

Returns
0 or error number
Parameters
xidin: X/Open XA transaction identification

Definition at line 9327 of file ha_innodb.cc.

◆ doXaPrepare()

int InnobaseEngine::doXaPrepare ( Session * session,
bool all )
virtual

This function is used to prepare an X/Open XA distributed transaction.

Returns
0 or error number
Parameters
sessionin: handle to the MySQL thread of the user whose XA transaction should be prepared
allin: TRUE - commit transaction FALSE - the current SQL statement ended

Definition at line 9214 of file ha_innodb.cc.

◆ doXaRecover()

int InnobaseEngine::doXaRecover ( ::drizzled::XID * xid_list,
size_t len )
virtual

This function is used to recover X/Open XA distributed transactions.

Returns
number of prepared transactions stored in xid_list
Parameters
xid_listin/out: prepared transactions
lenin: number of slots in xid_list

Definition at line 9307 of file ha_innodb.cc.

◆ doXaRollback()

virtual int InnobaseEngine::doXaRollback ( Session * session,
bool all )
inlinevirtual

Definition at line 443 of file ha_innodb.cc.

◆ doXaRollbackXid()

int InnobaseEngine::doXaRollbackXid ( ::drizzled::XID * xid)
virtual

This function is used to rollback one X/Open XA distributed transaction which is in the prepared state

Returns
0 or error number
Parameters
xidin: X/Open XA transaction identification

Definition at line 9351 of file ha_innodb.cc.

◆ dropTemporarySchema()

void InnobaseEngine::dropTemporarySchema ( )

Definition at line 6884 of file ha_innodb.cc.

◆ flush_logs()

bool InnobaseEngine::flush_logs ( )
virtual

Flushes InnoDB logs to disk and makes a checkpoint. Really, a commit flushes the logs, and the name of this function should be innobase_checkpoint.

Returns
TRUE if error

Definition at line 2734 of file ha_innodb.cc.

◆ get_error_message()

UNIV_INTERN bool InnobaseEngine::get_error_message ( int error,
String * buf ) const
virtual

Definition at line 9026 of file ha_innodb.cc.

◆ index_flags()

UNIV_INTERN uint32_t InnobaseEngine::index_flags ( drizzled::message::Table::Index::IndexType ) const
inline

Definition at line 554 of file ha_innodb.cc.

◆ max_supported_key_length()

UNIV_INTERN uint32_t InnobaseEngine::max_supported_key_length ( ) const

Returns the maximum key length.

Returns
maximum supported key length, in bytes

Definition at line 3150 of file ha_innodb.cc.

◆ max_supported_key_part_length()

UNIV_INTERN uint32_t InnobaseEngine::max_supported_key_part_length ( ) const

Definition at line 3827 of file ha_innodb.cc.

◆ max_supported_keys()

UNIV_INTERN uint InnobaseEngine::max_supported_keys ( ) const

Returns the maximum number of keys.

Returns
MAX_KEY

Definition at line 3139 of file ha_innodb.cc.

◆ show_status()

bool InnobaseEngine::show_status ( Session * session,
stat_print_fn * stat_print,
enum ha_stat_type stat_type )
virtual

Definition at line 8589 of file ha_innodb.cc.

◆ validateCreateTableOption()

bool InnobaseEngine::validateCreateTableOption ( const std::string & key,
const std::string & state )

Definition at line 578 of file ha_innodb.cc.


The documentation for this class was generated from the following file: