PageRenderTime 37ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/mysql-5.5.25a/include/mysql/plugin_audit.h.pp

#
Puppet | 240 lines | 232 code | 0 blank | 8 comment | 0 complexity | cb63d40fd05f6d1d0e048c46a241269c MD5 | raw file
Possible License(s): GPL-2.0, BSD-3-Clause
  1. #include "plugin.h"
  2. #include <mysql/services.h>
  3. #include <mysql/service_my_snprintf.h>
  4. extern struct my_snprintf_service_st {
  5. size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
  6. size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
  7. } *my_snprintf_service;
  8. size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
  9. size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
  10. #include <mysql/service_thd_alloc.h>
  11. struct st_mysql_lex_string
  12. {
  13. char *str;
  14. size_t length;
  15. };
  16. typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
  17. extern struct thd_alloc_service_st {
  18. void *(*thd_alloc_func)(void*, unsigned int);
  19. void *(*thd_calloc_func)(void*, unsigned int);
  20. char *(*thd_strdup_func)(void*, const char *);
  21. char *(*thd_strmake_func)(void*, const char *, unsigned int);
  22. void *(*thd_memdup_func)(void*, const void*, unsigned int);
  23. MYSQL_LEX_STRING *(*thd_make_lex_string_func)(void*, MYSQL_LEX_STRING *,
  24. const char *, unsigned int, int);
  25. } *thd_alloc_service;
  26. void *thd_alloc(void* thd, unsigned int size);
  27. void *thd_calloc(void* thd, unsigned int size);
  28. char *thd_strdup(void* thd, const char *str);
  29. char *thd_strmake(void* thd, const char *str, unsigned int size);
  30. void *thd_memdup(void* thd, const void* str, unsigned int size);
  31. MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
  32. const char *str, unsigned int size,
  33. int allocate_lex_string);
  34. #include <mysql/service_thd_wait.h>
  35. typedef enum _thd_wait_type_e {
  36. THD_WAIT_SLEEP= 1,
  37. THD_WAIT_DISKIO= 2,
  38. THD_WAIT_ROW_LOCK= 3,
  39. THD_WAIT_GLOBAL_LOCK= 4,
  40. THD_WAIT_META_DATA_LOCK= 5,
  41. THD_WAIT_TABLE_LOCK= 6,
  42. THD_WAIT_USER_LOCK= 7,
  43. THD_WAIT_BINLOG= 8,
  44. THD_WAIT_GROUP_COMMIT= 9,
  45. THD_WAIT_SYNC= 10,
  46. THD_WAIT_LAST= 11
  47. } thd_wait_type;
  48. extern struct thd_wait_service_st {
  49. void (*thd_wait_begin_func)(void*, int);
  50. void (*thd_wait_end_func)(void*);
  51. } *thd_wait_service;
  52. void thd_wait_begin(void* thd, int wait_type);
  53. void thd_wait_end(void* thd);
  54. #include <mysql/service_thread_scheduler.h>
  55. struct scheduler_functions;
  56. extern struct my_thread_scheduler_service {
  57. int (*set)(struct scheduler_functions *scheduler);
  58. int (*reset)();
  59. } *my_thread_scheduler_service;
  60. int my_thread_scheduler_set(struct scheduler_functions *scheduler);
  61. int my_thread_scheduler_reset();
  62. struct st_mysql_xid {
  63. long formatID;
  64. long gtrid_length;
  65. long bqual_length;
  66. char data[128];
  67. };
  68. typedef struct st_mysql_xid MYSQL_XID;
  69. enum enum_mysql_show_type
  70. {
  71. SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG,
  72. SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
  73. SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE,
  74. SHOW_always_last
  75. };
  76. struct st_mysql_show_var {
  77. const char *name;
  78. char *value;
  79. enum enum_mysql_show_type type;
  80. };
  81. typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *);
  82. struct st_mysql_sys_var;
  83. struct st_mysql_value;
  84. typedef int (*mysql_var_check_func)(void* thd,
  85. struct st_mysql_sys_var *var,
  86. void *save, struct st_mysql_value *value);
  87. typedef void (*mysql_var_update_func)(void* thd,
  88. struct st_mysql_sys_var *var,
  89. void *var_ptr, const void *save);
  90. struct st_mysql_plugin
  91. {
  92. int type;
  93. void *info;
  94. const char *name;
  95. const char *author;
  96. const char *descr;
  97. int license;
  98. int (*init)(void *);
  99. int (*deinit)(void *);
  100. unsigned int version;
  101. struct st_mysql_show_var *status_vars;
  102. struct st_mysql_sys_var **system_vars;
  103. void * __reserved1;
  104. unsigned long flags;
  105. };
  106. #include "plugin_ftparser.h"
  107. #include "plugin.h"
  108. enum enum_ftparser_mode
  109. {
  110. MYSQL_FTPARSER_SIMPLE_MODE= 0,
  111. MYSQL_FTPARSER_WITH_STOPWORDS= 1,
  112. MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2
  113. };
  114. enum enum_ft_token_type
  115. {
  116. FT_TOKEN_EOF= 0,
  117. FT_TOKEN_WORD= 1,
  118. FT_TOKEN_LEFT_PAREN= 2,
  119. FT_TOKEN_RIGHT_PAREN= 3,
  120. FT_TOKEN_STOPWORD= 4
  121. };
  122. typedef struct st_mysql_ftparser_boolean_info
  123. {
  124. enum enum_ft_token_type type;
  125. int yesno;
  126. int weight_adjust;
  127. char wasign;
  128. char trunc;
  129. char prev;
  130. char *quot;
  131. } MYSQL_FTPARSER_BOOLEAN_INFO;
  132. typedef struct st_mysql_ftparser_param
  133. {
  134. int (*mysql_parse)(struct st_mysql_ftparser_param *,
  135. char *doc, int doc_len);
  136. int (*mysql_add_word)(struct st_mysql_ftparser_param *,
  137. char *word, int word_len,
  138. MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
  139. void *ftparser_state;
  140. void *mysql_ftparam;
  141. struct charset_info_st *cs;
  142. char *doc;
  143. int length;
  144. int flags;
  145. enum enum_ftparser_mode mode;
  146. } MYSQL_FTPARSER_PARAM;
  147. struct st_mysql_ftparser
  148. {
  149. int interface_version;
  150. int (*parse)(MYSQL_FTPARSER_PARAM *param);
  151. int (*init)(MYSQL_FTPARSER_PARAM *param);
  152. int (*deinit)(MYSQL_FTPARSER_PARAM *param);
  153. };
  154. struct st_mysql_daemon
  155. {
  156. int interface_version;
  157. };
  158. struct st_mysql_information_schema
  159. {
  160. int interface_version;
  161. };
  162. struct st_mysql_storage_engine
  163. {
  164. int interface_version;
  165. };
  166. struct handlerton;
  167. struct Mysql_replication {
  168. int interface_version;
  169. };
  170. struct st_mysql_value
  171. {
  172. int (*value_type)(struct st_mysql_value *);
  173. const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
  174. int (*val_real)(struct st_mysql_value *, double *realbuf);
  175. int (*val_int)(struct st_mysql_value *, long long *intbuf);
  176. int (*is_unsigned)(struct st_mysql_value *);
  177. };
  178. int thd_in_lock_tables(const void* thd);
  179. int thd_tablespace_op(const void* thd);
  180. long long thd_test_options(const void* thd, long long test_options);
  181. int thd_sql_command(const void* thd);
  182. const char *thd_proc_info(void* thd, const char *info);
  183. void **thd_ha_data(const void* thd, const struct handlerton *hton);
  184. void thd_storage_lock_wait(void* thd, long long value);
  185. int thd_tx_isolation(const void* thd);
  186. char *thd_security_context(void* thd, char *buffer, unsigned int length,
  187. unsigned int max_query_len);
  188. void thd_inc_row_count(void* thd);
  189. int mysql_tmpfile(const char *prefix);
  190. int thd_killed(const void* thd);
  191. unsigned long thd_get_thread_id(const void* thd);
  192. void thd_get_xid(const void* thd, MYSQL_XID *xid);
  193. void mysql_query_cache_invalidate4(void* thd,
  194. const char *key, unsigned int key_length,
  195. int using_trx);
  196. void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
  197. void thd_set_ha_data(void* thd, const struct handlerton *hton,
  198. const void *ha_data);
  199. struct mysql_event_general
  200. {
  201. unsigned int event_subclass;
  202. int general_error_code;
  203. unsigned long general_thread_id;
  204. const char *general_user;
  205. unsigned int general_user_length;
  206. const char *general_command;
  207. unsigned int general_command_length;
  208. const char *general_query;
  209. unsigned int general_query_length;
  210. struct charset_info_st *general_charset;
  211. unsigned long long general_time;
  212. unsigned long long general_rows;
  213. };
  214. struct mysql_event_connection
  215. {
  216. unsigned int event_subclass;
  217. int status;
  218. unsigned long thread_id;
  219. const char *user;
  220. unsigned int user_length;
  221. const char *priv_user;
  222. unsigned int priv_user_length;
  223. const char *external_user;
  224. unsigned int external_user_length;
  225. const char *proxy_user;
  226. unsigned int proxy_user_length;
  227. const char *host;
  228. unsigned int host_length;
  229. const char *ip;
  230. unsigned int ip_length;
  231. const char *database;
  232. unsigned int database_length;
  233. };
  234. struct st_mysql_audit
  235. {
  236. int interface_version;
  237. void (*release_thd)(void*);
  238. void (*event_notify)(void*, unsigned int, const void *);
  239. unsigned long class_mask[1];
  240. };