Drizzled Public API Documentation

InnobaseEngine Class Reference
Inheritance diagram for InnobaseEngine:

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 Cursorcreate (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 (enum ha_key_alg) 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 372 of file ha_innodb.cc.

Member Function Documentation

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 2997 of file ha_innodb.cc.

References trx_struct::conc_state, innobase_rollback_trx(), session_to_trx(), thr_local_free(), trx_free_for_mysql(), trx_struct::undo_no, and ut_a.

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 2715 of file ha_innodb.cc.

References check_trx_exists(), commit_threads, trx_struct::conc_state, innobase_commit_low(), trx_struct::n_autoinc_rows, read_view_close_for_mysql(), row_unlock_table_autoinc_for_mysql(), srv_active_wake_master_thread(), srv_conc_force_exit_innodb(), trx_commit_complete_for_mysql(), trx_mark_sql_stat_end(), and trx_search_latch_release_if_reserved().

UNIV_INTERN int InnobaseEngine::doCreateTable ( Session session,
Table form,
const identifier::Table identifier,
const message::Table create_proto 
)
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 6727 of file ha_innodb.cc.

References check_trx_exists(), innobase_commit_low(), innobase_trx_allocate(), log_buffer_flush_to_disk(), row_drop_database_for_mysql(), srv_active_wake_master_thread(), trx_free_for_mysql(), and trx_search_latch_release_if_reserved().

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 6632 of file ha_innodb.cc.

References check_trx_exists(), convert_error_code_to_mysql(), trx_struct::id, innobase_commit_low(), innobase_trx_allocate(), log_buffer_flush_to_disk(), row_drop_table_for_mysql(), srv_active_wake_master_thread(), trx_free_for_mysql(), trx_search_latch_release_if_reserved(), and ut_a.

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 2939 of file ha_innodb.cc.

References check_trx_exists(), convert_error_code_to_mysql(), and trx_release_savepoint_for_mysql().

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 1056 of file ha_innodb.cc.

References innobase_release_stat_resources(), and session_to_trx().

UNIV_INTERN int InnobaseEngine::doRenameTable ( Session session,
const identifier::Table from,
const identifier::Table to 
)
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 2830 of file ha_innodb.cc.

References check_trx_exists(), convert_error_code_to_mysql(), innobase_release_stat_resources(), trx_struct::n_autoinc_rows, read_view_close_for_mysql(), row_unlock_table_autoinc_for_mysql(), trx_rollback_for_mysql(), and trx_rollback_last_sql_stat_for_mysql().

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 2909 of file ha_innodb.cc.

References check_trx_exists(), convert_error_code_to_mysql(), innobase_release_stat_resources(), and trx_rollback_to_savepoint_for_mysql().

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 2961 of file ha_innodb.cc.

References check_trx_exists(), trx_struct::conc_state, convert_error_code_to_mysql(), innobase_release_stat_resources(), and trx_savepoint_for_mysql().

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 9023 of file ha_innodb.cc.

References check_trx_exists(), trx_struct::detailed_error, and innobase_map_isolation_level().

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 2684 of file ha_innodb.cc.

References check_trx_exists(), innobase_release_stat_resources(), trx_assign_read_view(), and trx_start_if_not_started().

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 9170 of file ha_innodb.cc.

References innobase_commit_low(), and trx_get_trx_by_xid().

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 9057 of file ha_innodb.cc.

References check_trx_exists(), trx_struct::conc_state, innobase_release_stat_resources(), row_unlock_table_autoinc_for_mysql(), srv_active_wake_master_thread(), trx_struct::support_xa, trx_mark_sql_stat_end(), trx_prepare_for_mysql(), ut_ad, and trx_struct::xid.

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 9150 of file ha_innodb.cc.

References trx_recover_for_mysql().

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 9194 of file ha_innodb.cc.

References innobase_rollback_trx(), and trx_get_trx_by_xid().

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 2649 of file ha_innodb.cc.

References log_buffer_flush_to_disk().

UNIV_INTERN uint32_t InnobaseEngine::max_supported_key_length ( void  ) const

Returns the maximum key length.

Returns
maximum supported key length, in bytes

Definition at line 3066 of file ha_innodb.cc.

UNIV_INTERN uint InnobaseEngine::max_supported_keys ( void  ) const

Returns the maximum number of keys.

Returns
MAX_KEY

Definition at line 3055 of file ha_innodb.cc.


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