mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / storage / innobase / include / ha_prototypes.h
blob3aa70e8f4ae4bcacb5d15fcf69cf17d3a5b39f42
1 #ifndef HA_INNODB_PROTOTYPES_H
2 #define HA_INNODB_PROTOTYPES_H
4 #ifndef UNIV_HOTBACKUP
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
10 InnoDB's C-code. */
12 /*************************************************************************
13 Wrapper around MySQL's copy_and_convert function, see it for
14 documentation. */
16 ulint
17 innobase_convert_string(
18 /*====================*/
19 void* to,
20 ulint to_length,
21 CHARSET_INFO* to_cs,
22 const void* from,
23 ulint from_length,
24 CHARSET_INFO* from_cs,
25 uint* errors);
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 */
32 char*
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(). */
50 ibool
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. */
62 ibool
63 thd_has_edited_nontrans_tables(
64 /*===========================*/
65 /* out: true if non-transactional tables have
66 been edited */
67 void* thd); /* in: thread handle (THD*) */
69 /**********************************************************************
70 Returns true if the thread is executing a SELECT statement. */
72 ibool
73 thd_is_select(
74 /*==========*/
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. */
83 my_bool
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. */
92 uint
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. */
102 uint
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 */
109 #endif
110 #endif