1 #ifndef HA_INNODB_PROTOTYPES_H
2 #define HA_INNODB_PROTOTYPES_H
6 #include "univ.i" /* ulint, uint */
7 #include "m_ctype.h" /* CHARSET_INFO */
9 /* Prototypes for global functions in ha_innodb.cc that are called by
12 /*************************************************************************
13 Wrapper around MySQL's copy_and_convert function, see it for
17 innobase_convert_string(
18 /*====================*/
24 CHARSET_INFO
* from_cs
,
27 /*****************************************************************//**
28 Convert a table or index name to the MySQL system_charset_info (UTF-8)
29 and quote it if needed.
30 @return pointer to the end of buf */
33 innobase_convert_name(
34 /*==================*/
35 char* buf
, /*!< out: buffer for converted identifier */
36 ulint buflen
, /*!< in: length of buf, in bytes */
37 const char* id
, /*!< in: identifier to convert */
38 ulint idlen
, /*!< in: length of id, in bytes */
39 void* thd
, /*!< in: MySQL connection thread, or NULL */
40 ibool table_id
);/*!< in: TRUE=id is a table or database name;
41 FALSE=id is an index name */
43 /**********************************************************************
44 Returns true if the thread is the replication thread on the slave
45 server. Used in srv_conc_enter_innodb() to determine if the thread
46 should be allowed to enter InnoDB - the replication thread is treated
47 differently than other threads. Also used in
48 srv_conc_force_exit_innodb(). */
51 thd_is_replication_slave_thread(
52 /*============================*/
53 /* out: true if thd is the replication thread */
54 void* thd
); /* in: thread handle (THD*) */
56 /**********************************************************************
57 Returns true if the transaction this thread is processing has edited
58 non-transactional tables. Used by the deadlock detector when deciding
59 which transaction to rollback in case of a deadlock - we try to avoid
60 rolling back transactions that have edited non-transactional tables. */
63 thd_has_edited_nontrans_tables(
64 /*===========================*/
65 /* out: true if non-transactional tables have
67 void* thd
); /* in: thread handle (THD*) */
69 /**********************************************************************
70 Returns true if the thread is executing a SELECT statement. */
75 /* out: true if thd is executing SELECT */
76 const void* thd
); /* in: thread handle (THD*) */
78 /**********************************************************************
79 Check if the length of the identifier exceeds the maximum allowed.
80 The input to this function is an identifier in charset my_charset_filename.
81 return true when length of identifier is too long. */
84 innobase_check_identifier_length(
85 /*=============================*/
86 const char* id
); /* in: identifier to check. it must belong
87 to charset my_charset_filename */
89 /**********************************************************************
90 Converts an identifier from my_charset_filename to UTF-8 charset. */
93 innobase_convert_to_system_charset(
94 /*===============================*/
95 char* to
, /* out: converted identifier */
96 const char* from
, /* in: identifier to convert */
97 ulint len
, /* in: length of 'to', in bytes */
98 uint
* errors
); /* out: error return */
100 /**********************************************************************
101 Converts an identifier from my_charset_filename to UTF-8 charset. */
103 innobase_convert_to_filename_charset(
104 /*=================================*/
105 char* to
, /* out: converted identifier */
106 const char* from
, /* in: identifier to convert */
107 ulint len
); /* in: length of 'to', in bytes */