drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
ha_prototypes.h File Reference
#include "trx0types.h"
#include "m_ctype.h"
Include dependency graph for ha_prototypes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  drizzled
 TODO: Rename this file - func.h is stupid.

Functions

UNIV_INTERN ulint innobase_convert_string (void *to, ulint to_length, drizzled::CHARSET_INFO *to_cs, const void *from, ulint from_length, drizzled::CHARSET_INFO *from_cs, uint *errors)
UNIV_INTERN ulint innobase_raw_format (const char *data, ulint data_len, ulint charset_coll, char *buf, ulint buf_size)
UNIV_INTERN void innobase_invalidate_query_cache (trx_t *trx, const char *full_name, ulint full_name_len)
UNIV_INTERN char * innobase_convert_name (char *buf, ulint buflen, const char *id, ulint idlen, drizzled::Session *thd, ibool table_id)
UNIV_INTERN ibool thd_is_replication_slave_thread (drizzled::Session *thd)
UNIV_INTERN ibool thd_has_edited_nontrans_tables (drizzled::Session *thd)
UNIV_INTERN void innobase_mysql_print_thd (FILE *f, drizzled::Session *thd, uint max_query_len)
UNIV_INTERN ulint get_innobase_type_from_mysql_type (ulint *unsigned_flag, const void *field) __attribute__((nonnull))
UNIV_INTERN void innobase_get_cset_width (ulint cset, ulint *mbminlen, ulint *mbmaxlen)
UNIV_INTERN int innobase_strcasecmp (const char *a, const char *b)
UNIV_INTERN const char * innobase_basename (const char *path_name)
UNIV_INTERN ibool thd_is_select (const drizzled::Session *thd)
UNIV_INTERN void innobase_convert_from_table_id (const void *cs, char *to, const char *from, ulint len)
UNIV_INTERN void innobase_convert_from_id (const void *cs, char *to, const char *from, ulint len)
UNIV_INTERN void innobase_casedn_str (char *a)
const void * innobase_get_charset (drizzled::Session *mysql_thd)
UNIV_INTERN const char * innobase_get_stmt (drizzled::Session *mysql_thd, size_t *length) __attribute__((nonnull))
UNIV_INTERN ulint innobase_get_at_most_n_mbchars (ulint charset_id, ulint prefix_len, ulint data_len, const char *str)
UNIV_INTERN ibool thd_supports_xa (drizzled::Session *thd)
UNIV_INTERN ulong thd_lock_wait_timeout (drizzled::Session *thd)
UNIV_INTERN void thd_set_lock_wait_time (drizzled::Session *thd, ulint value)
UNIV_INTERN bool innobase_isspace (const void *cs, char char_to_test)
UNIV_INTERN int innobase_fast_mutex_init (os_fast_mutex_t *fast_mutex)

Detailed Description

Prototypes for global functions in ha_innodb.cc that are called by InnoDB C code

Created 5/11/2006 Osku Salerma

Definition in file ha_prototypes.h.

Macro Definition Documentation

◆ HA_INNODB_PROTOTYPES_H

#define HA_INNODB_PROTOTYPES_H

Definition at line 29 of file ha_prototypes.h.

Function Documentation

◆ get_innobase_type_from_mysql_type()

UNIV_INTERN ulint get_innobase_type_from_mysql_type ( ulint * unsigned_flag,
const void * f )

Converts a MySQL type to an InnoDB type. Note that this function returns the 'mtype' of InnoDB. InnoDB differentiates between MySQL's old <= 4.1 VARCHAR and the new true VARCHAR in >= 5.0.3 by the 'prtype'.

Returns
DATA_BINARY, DATA_VARCHAR, ...
Parameters
unsigned_flagout: DATA_UNSIGNED if an 'unsigned type'; at least ENUM and SET, and unsigned integer types are 'unsigned types'
fin: MySQL Field

Definition at line 4015 of file ha_innodb.cc.

◆ innobase_basename()

UNIV_INTERN const char * innobase_basename ( const char * path_name)

Strip dir name from a full path name and return only its file name.

Returns
file name or "null" if no file name in: full path name

Strip dir name from a full path name and return only the file name

Returns
file name or "null" if no file name
Parameters
path_namein: full path name

Definition at line 1355 of file ha_innodb.cc.

◆ innobase_casedn_str()

UNIV_INTERN void innobase_casedn_str ( char * a)

Makes all characters in a NUL-terminated UTF-8 string lower case. in/out: string to put in lower case

Makes all characters in a NUL-terminated UTF-8 string lower case.

Parameters
ain/out: string to put in lower case

Definition at line 1368 of file ha_innodb.cc.

◆ innobase_convert_from_id()

UNIV_INTERN void innobase_convert_from_id ( const void * cs,
char * to,
const char * from,
ulint len )

Converts an identifier to UTF-8. in: length of 'to', in bytes; should be at least 3 * strlen(to) + 1

Converts an identifier to UTF-8.

Parameters
csin: the 'from' character set
toout: converted identifier
fromin: identifier to convert
lenin: length of 'to', in bytes

Definition at line 1328 of file ha_innodb.cc.

◆ innobase_convert_from_table_id()

UNIV_INTERN void innobase_convert_from_table_id ( const void * cs,
char * to,
const char * from,
ulint len )

Converts an identifier to a table name. in: length of 'to', in bytes; should be at least 5 * strlen(to) + 1

Converts an identifier to a table name.

Parameters
csin: the 'from' character set
toout: converted identifier
fromin: identifier to convert
lenin: length of 'to', in bytes

Definition at line 1314 of file ha_innodb.cc.

◆ innobase_convert_name()

UNIV_INTERN char * innobase_convert_name ( char * buf,
ulint buflen,
const char * id,
ulint idlen,
drizzled::Session * session,
ibool table_id )

Convert a table or index name to the MySQL system_charset_info (UTF-8) and quote it if needed.

Returns
pointer to the end of buf in: TRUE=id is a table or database name; FALSE=id is an index name

Convert a table or index name to the MySQL system_charset_info (UTF-8) and quote it if needed.

Returns
pointer to the end of buf
Parameters
bufout: buffer for converted identifier
buflenin: length of buf, in bytes
idin: identifier to convert
idlenin: length of id, in bytes
sessionin: MySQL connection thread, or NULL
table_idin: TRUE=id is a table or database name; FALSE=id is an index name

Definition at line 1818 of file ha_innodb.cc.

◆ innobase_convert_string()

UNIV_INTERN ulint innobase_convert_string ( void * to,
ulint to_length,
drizzled::CHARSET_INFO * to_cs,
const void * from,
ulint from_length,
drizzled::CHARSET_INFO * from_cs,
uint * errors )

Wrapper around MySQL's copy_and_convert function.

Returns
number of bytes copied to 'to' out: number of errors encountered during the conversion
Parameters
toout: converted string
to_lengthin: number of bytes reserved for the converted string
to_csin: character set to convert to
fromin: string to convert
from_lengthin: number of bytes to convert
from_csin: character set to convert from

◆ innobase_get_at_most_n_mbchars()

UNIV_INTERN ulint innobase_get_at_most_n_mbchars ( ulint charset_id,
ulint prefix_len,
ulint data_len,
const char * str )

This function is used to find the storage length in bytes of the first n characters for prefix indexes using a multibyte character set. The function finds charset information and returns length of prefix_len characters in the index field in bytes.

Returns
number of bytes occupied by the first n characters in: character string

< character length in bytes

< number of characters in prefix

< charset used in the field

Parameters
charset_idin: character set id
prefix_lenin: prefix length in bytes of the index (this has to be divided by mbmaxlen to get the number of CHARACTERS n in the prefix)
data_lenin: length of the string in bytes
strin: character string

Definition at line 9112 of file ha_innodb.cc.

◆ innobase_get_charset()

const void * innobase_get_charset ( drizzled::Session * mysql_thd)

Determines the connection character set.

Returns
connection character set in: MySQL thread handle

◆ innobase_get_cset_width()

UNIV_INTERN void innobase_get_cset_width ( ulint cset,
ulint * mbminlen,
ulint * mbmaxlen )

Get the variable length bounds of the given character set. out: maximum length of a char (in bytes)

Get the variable length bounds of the given character set.

Parameters
csetin: MySQL charset-collation code
mbminlenout: minimum length of a char (in bytes)
mbmaxlenout: maximum length of a char (in bytes)

Definition at line 1287 of file ha_innodb.cc.

◆ innobase_get_stmt()

UNIV_INTERN const char * innobase_get_stmt ( drizzled::Session * mysql_thd,
size_t * length )

Determines the current SQL statement.

Returns
SQL statement string
Parameters
mysql_thdin: MySQL thread handle
lengthout: length of the SQL statement

Definition at line 760 of file xtrabackup.cc.

◆ innobase_invalidate_query_cache()

UNIV_INTERN void innobase_invalidate_query_cache ( trx_t * trx,
const char * full_name,
ulint full_name_len )

Invalidates the MySQL query cache for the table. in: full name length where also the null chars count

Parameters
trxin: transaction which modifies the table
full_namein: concatenation of database name, null char NUL, table name, null char NUL; NOTE that in Windows this is always in LOWER CASE!

Definition at line 806 of file xtrabackup.cc.

◆ innobase_isspace()

UNIV_INTERN bool innobase_isspace ( const void * cs,
char char_to_test )

Definition at line 1377 of file ha_innodb.cc.

◆ innobase_mysql_print_thd()

UNIV_INTERN void innobase_mysql_print_thd ( FILE * f,
drizzled::Session * in_session,
uint max_query_len )

Prints info of a THD object (== user session thread) to the given file. in: max query length to print, or 0 to use the default max length

Prints info of a Session object (== user session thread) to the given file.

Parameters
fin: output stream
in_sessionin: pointer to a Drizzle Session object
max_query_lenin: max query length to print, or 0 to use the default max length

Definition at line 1262 of file ha_innodb.cc.

◆ innobase_raw_format()

UNIV_INTERN ulint innobase_raw_format ( const char * data,
ulint data_len,
ulint charset_coll,
char * buf,
ulint buf_size )

Formats the raw data in "data" (in InnoDB on-disk format) that is of type DATA_(CHAR|VARCHAR|MYSQL|VARMYSQL) using "charset_coll" and writes the result to "buf". The result is converted to "system_charset_info". Not more than "buf_size" bytes are written to "buf". The result is always NUL-terminated (provided buf_size > 0) and the number of bytes that were written to "buf" is returned (including the terminating NUL).

Returns
number of bytes that were written in: output buffer size in bytes

Formats the raw data in "data" (in InnoDB on-disk format) that is of type DATA_(CHAR|VARCHAR|DRIZZLE|VARDRIZZLE) using "charset_coll" and writes the result to "buf". The result is converted to "system_charset_info". Not more than "buf_size" bytes are written to "buf". The result is always NUL-terminated (provided buf_size > 0) and the number of bytes that were written to "buf" is returned (including the terminating NUL).

Returns
number of bytes that were written
Parameters
datain: raw data
data_lenin: raw data length in bytes
charset_collin: charset collation
bufout: output buffer
buf_sizein: output buffer size in bytes

Definition at line 1516 of file ha_innodb.cc.

◆ innobase_strcasecmp()

UNIV_INTERN int innobase_strcasecmp ( const char * a,
const char * b )

Compares NUL-terminated UTF-8 strings case insensitively.

Returns
0 if a=b, <0 if a<b, >1 if a>b in: second string to compare

Compares NUL-terminated UTF-8 strings case insensitively.

Returns
0 if a=b, <0 if a<b, >1 if a>b
Parameters
ain: first string to compare
bin: second string to compare

Definition at line 1343 of file ha_innodb.cc.

◆ thd_has_edited_nontrans_tables()

UNIV_INTERN ibool thd_has_edited_nontrans_tables ( drizzled::Session * session)

Returns true if the transaction this thread is processing has edited non-transactional tables. Used by the deadlock detector when deciding which transaction to rollback in case of a deadlock - we try to avoid rolling back transactions that have edited non-transactional tables.

Returns
true if non-transactional tables have been edited in: thread handle (THD*)

Returns true if the transaction this thread is processing has edited non-transactional tables. Used by the deadlock detector when deciding which transaction to rollback in case of a deadlock - we try to avoid rolling back transactions that have edited non-transactional tables.

DRIZZLE: Note, we didn't change this name to avoid more ifdef forking in non-Cursor code.

Returns
true if non-transactional tables have been edited
Parameters
sessionin: thread handle (Session*)

Definition at line 958 of file ha_innodb.cc.

◆ thd_is_replication_slave_thread()

UNIV_INTERN ibool thd_is_replication_slave_thread ( drizzled::Session * thd)

Returns true if the thread is the replication thread on the slave server. Used in srv_conc_enter_innodb() to determine if the thread should be allowed to enter InnoDB - the replication thread is treated differently than other threads. Also used in srv_conc_force_exit_innodb().

Returns
true if thd is the replication thread in: thread handle (THD*)

Returns true if the thread is the replication thread on the slave server. Used in srv_conc_enter_innodb() to determine if the thread should be allowed to enter InnoDB - the replication thread is treated differently than other threads. Also used in srv_conc_force_exit_innodb().

DRIZZLE: Note, we didn't change this name to avoid more ifdef forking in non-Cursor code.

Returns
true if session is the replication thread
Parameters
thdin: thread handle (Session*)

Definition at line 884 of file ha_innodb.cc.

◆ thd_is_select()

UNIV_INTERN ibool thd_is_select ( const drizzled::Session * session)

Returns true if the thread is executing a SELECT statement.

Returns
true if thd is executing SELECT in: thread handle (THD*)

Returns true if the thread is executing a SELECT statement.

Returns
true if session is executing SELECT
Parameters
sessionin: thread handle (Session*)

Definition at line 970 of file ha_innodb.cc.

◆ thd_lock_wait_timeout()

UNIV_INTERN ulong thd_lock_wait_timeout ( drizzled::Session * thd)

Returns the lock wait timeout for the current connection.

Returns
the lock wait timeout, in seconds in: thread handle (THD*), or NULL to query the global innodb_lock_wait_timeout

Returns the lock wait timeout for the current connection.

Returns
the lock wait timeout, in seconds
Parameters
thdin: thread handle (Session*), or NULL to query the global innodb_lock_wait_timeout

Definition at line 997 of file ha_innodb.cc.

◆ thd_set_lock_wait_time()

UNIV_INTERN void thd_set_lock_wait_time ( drizzled::Session * in_session,
ulint value )

Add up the time waited for the lock for the current query. in: time waited for the lock

Set the time waited for the lock for the current query.

Parameters
in_sessionin: thread handle (THD*)
valuein: time waited for the lock

Definition at line 1012 of file ha_innodb.cc.

◆ thd_supports_xa()

UNIV_INTERN ibool thd_supports_xa ( drizzled::Session * thd)

Returns true if the thread supports XA, global value of innodb_supports_xa if thd is NULL.

Returns
true if thd supports XA in: thread handle (THD*), or NULL to query the global innodb_supports_xa

Returns true if the thread supports XA, global value of innodb_supports_xa if session is NULL.

Returns
true if session has XA support
Parameters
thdin: thread handle (Session*), or NULL to query the global innodb_supports_xa

Definition at line 983 of file ha_innodb.cc.