Drizzled Public API Documentation

InnobaseEngine Class Reference

List of all members.

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 304 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 2777 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 2495 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 
)

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

References check_trx_exists(), convert_error_code_to_mysql(), create_clustered_index_when_no_primary(), create_index(), create_table_def(), dict_table_get_format(), DICT_TF2_SHIFT, DICT_TF2_TEMPORARY, DICT_TF_COMPACT, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_ZIP, DICT_TF_ZSSIZE_SHIFT, trx_struct::id, innobase_commit_low(), innobase_trx_allocate(), drizzled::Table::key_info, log_buffer_flush_to_disk(), row_mysql_unlock_data_dictionary(), row_table_add_foreign_constraints(), srv_active_wake_master_thread(), srv_file_format, srv_file_per_table, trx_free_for_mysql(), trx_search_latch_release_if_reserved(), and trx_sys_file_format_max_upgrade().

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 6521 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 6426 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 2719 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 981 of file ha_innodb.cc.

References innobase_release_stat_resources(), and session_to_trx().

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 2610 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 2689 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 2741 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) [private, virtual]

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 8859 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 
) [private, virtual]

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 2464 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 9006 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 8893 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 8986 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 9030 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 2429 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 2846 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 2835 of file ha_innodb.cc.


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