For the complete documentation index, see llms.txt. This page is also available as Markdown.

Services for Direct Access to Server Internals

Plugin API reference: Services for Direct Access to Server Internals. Generated from the MariaDB server headers by doxygen and moxygen.

Plugin API / Services for Plugins

These are callbacks to the server that predate the normal plugin service APIs

Groups

Name
Description

Access to WSREP functionality

Functions

Return
Name
Description

struct DDL_options_st *

int

Create a temporary file.

unsigned long

Return the thread id of a user thread

void

Invalidate the query cache for a given table.

void *

Provide a handler data getter to simplify coding

void

Provide a handler data setter to simplify coding

void

Signal that the first part of handler commit is finished, and that the committed transaction is now visible and has fixed commit ordering with respect to other transactions. The commit need not be durable yet, and typically will not be when this call makes sense.


thd_in_lock_tables

Defined in plugin.h:904


thd_tablespace_op

Defined in plugin.h:905


thd_test_options

Defined in plugin.h:906


thd_sql_command

Defined in plugin.h:907


thd_ddl_options

Defined in plugin.h:909


thd_storage_lock_wait

Defined in plugin.h:910


thd_tx_isolation

Defined in plugin.h:911


thd_tx_is_read_only

Defined in plugin.h:912


mysql_tmpfile

Defined in plugin.h:926

Create a temporary file.

The temporary file is created in a location specified by the mysql server configuration (–tmpdir option). The caller does not need to delete the file, it will be deleted automatically.

Parameters

Parameter
Type
Description

prefix

const char *

prefix for temporary file name

prefix

const char *

prefix for temporary file name

Return Values

Value
Description

-1

error

>=

0 a file handle that can be passed to dup or my_close


thd_get_thread_id

Defined in plugin.h:934

Return the thread id of a user thread

Returns

thread id

Parameters

Parameter
Type
Description

thd

const MYSQL_THD

user thread connection handle

thd

const MYSQL_THD

user thread connection handle


mysql_query_cache_invalidate4

Defined in plugin.h:958

Invalidate the query cache for a given table.

Parameters

Parameter
Type
Description

thd

user thread connection handle

key

const char *

databasename\0tablename\0

key_length

unsigned int

length of key in bytes, including the NUL bytes

using_trx

int

flag: TRUE if using transactions, FALSE otherwise

thd

user thread connection handle

key

const char *

databasename\0tablename\0

key_length

unsigned int

length of key in bytes, including the NUL bytes

using_trx

int

flag: TRUE if using transactions, FALSE otherwise


thd_get_ha_data

Defined in plugin.h:966

Provide a handler data getter to simplify coding


thd_set_ha_data

Defined in plugin.h:990

Provide a handler data setter to simplify coding

Set ha_data pointer (storage engine per-connection information).

To avoid unclean deactivation (uninstall) of storage engine plugin in the middle of transaction, additional storage engine plugin lock is acquired.

If ha_data is not null and storage engine plugin was not locked by thd_set_ha_data() in this connection before, storage engine plugin gets locked.

If ha_data is null and storage engine plugin was locked by thd_set_ha_data() in this connection before, storage engine plugin lock gets released.

If transaction_participant::close_connection() didn't reset ha_data, server does it immediately after calling transaction_participant::close_connection()


thd_wakeup_subsequent_commits

Defined in plugin.h:1025

Signal that the first part of handler commit is finished, and that the committed transaction is now visible and has fixed commit ordering with respect to other transactions. The commit need not be durable yet, and typically will not be when this call makes sense.

This call is optional, if the storage engine does not call it the upper layer will after the handler commit() method is done. However, the storage engine may choose to call it itself to increase the possibility for group commit.

In-order parallel replication uses this to apply different transaction in parallel, but delay the commits of later transactions until earlier transactions have committed first, thus achieving increased performance on multi-core systems while still preserving full transaction consistency.

The storage engine can call this from within the commit() method, typically after the commit record has been written to the transaction log, but before the log has been fsync()'ed. This will allow the next replicated transaction to proceed to commit before the first one has done fsync() or similar. Thus, it becomes possible for multiple sequential replicated transactions to share a single fsync() inside the engine in group commit.

Note that this method should not be called from within the commit_ordered() method, or any other place in the storage engine. When commit_ordered() is used (typically when binlog is enabled), the transaction coordinator takes care of this and makes group commit in the storage engine possible without any other action needed on the part of the storage engine. This function thd_wakeup_subsequent_commits() is only needed when no transaction coordinator is used, meaning a single storage engine and no binary log.

This page is licensed: GPLv2

spinner

Last updated

Was this helpful?