1#include "plugin.h" 2typedef void * MYSQL_PLUGIN; 3struct st_mysql_xid { 4 long formatID; 5 long gtrid_length; 6 long bqual_length; 7 char data[128]; 8}; 9typedef struct st_mysql_xid MYSQL_XID; 10enum enum_mysql_show_type 11{ 12 SHOW_UNDEF, SHOW_BOOL, 13 SHOW_INT, 14 SHOW_LONG, 15 SHOW_LONGLONG, 16 SHOW_CHAR, SHOW_CHAR_PTR, 17 SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE 18}; 19enum enum_mysql_show_scope 20{ 21 SHOW_SCOPE_UNDEF, 22 SHOW_SCOPE_GLOBAL 23}; 24struct st_mysql_show_var 25{ 26 const char *name; 27 char *value; 28 enum enum_mysql_show_type type; 29 enum enum_mysql_show_scope scope; 30}; 31typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *); 32struct st_mysql_sys_var; 33struct st_mysql_value; 34typedef int (*mysql_var_check_func)(void* thd, 35 struct st_mysql_sys_var *var, 36 void *save, struct st_mysql_value *value); 37typedef void (*mysql_var_update_func)(void* thd, 38 struct st_mysql_sys_var *var, 39 void *var_ptr, const void *save); 40struct st_mysql_plugin 41{ 42 int type; 43 void *info; 44 const char *name; 45 const char *author; 46 const char *descr; 47 int license; 48 int (*init)(MYSQL_PLUGIN); 49 int (*deinit)(MYSQL_PLUGIN); 50 unsigned int version; 51 struct st_mysql_show_var *status_vars; 52 struct st_mysql_sys_var **system_vars; 53 void * __reserved1; 54 unsigned long flags; 55}; 56struct st_mysql_daemon 57{ 58 int interface_version; 59}; 60struct st_mysql_information_schema 61{ 62 int interface_version; 63}; 64struct st_mysql_storage_engine 65{ 66 int interface_version; 67}; 68struct handlerton; 69 struct Mysql_replication { 70 int interface_version; 71 }; 72struct st_mysql_value 73{ 74 int (*value_type)(struct st_mysql_value *); 75 const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length); 76 int (*val_real)(struct st_mysql_value *, double *realbuf); 77 int (*val_int)(struct st_mysql_value *, long long *intbuf); 78 int (*is_unsigned)(struct st_mysql_value *); 79}; 80int thd_in_lock_tables(const void* thd); 81int thd_tablespace_op(const void* thd); 82long long thd_test_options(const void* thd, long long test_options); 83int thd_sql_command(const void* thd); 84const char *set_thd_proc_info(void* thd, const char *info, 85 const char *calling_func, 86 const char *calling_file, 87 const unsigned int calling_line); 88void **thd_ha_data(const void* thd, const struct handlerton *hton); 89void thd_storage_lock_wait(void* thd, long long value); 90int thd_tx_isolation(const void* thd); 91int thd_tx_is_read_only(const void* thd); 92void* thd_tx_arbitrate(void* requestor, void* holder); 93int thd_tx_priority(const void* thd); 94int thd_tx_is_dd_trx(const void* thd); 95char *thd_security_context(void* thd, char *buffer, size_t length, 96 size_t max_query_len); 97void thd_inc_row_count(void* thd); 98int thd_allow_batch(void* thd); 99void thd_mark_transaction_to_rollback(void* thd, int all); 100int mysql_tmpfile(const char *prefix); 101int thd_killed(const void* thd); 102void thd_set_kill_status(const void* thd); 103void thd_binlog_pos(const void* thd, 104 const char **file_var, 105 unsigned long long *pos_var); 106unsigned long thd_get_thread_id(const void* thd); 107void thd_get_xid(const void* thd, MYSQL_XID *xid); 108void mysql_query_cache_invalidate4(void* thd, 109 const char *key, unsigned int key_length, 110 int using_trx); 111void *thd_get_ha_data(const void* thd, const struct handlerton *hton); 112void thd_set_ha_data(void* thd, const struct handlerton *hton, 113 const void *ha_data); 114struct st_mysql_keyring 115{ 116 int interface_version; 117 my_bool (*mysql_key_store)(const char *key_id, const char *key_type, 118 const char* user_id, const void *key, size_t key_len); 119 my_bool (*mysql_key_fetch)(const char *key_id, char **key_type, 120 const char *user_id, void **key, size_t *key_len); 121 my_bool (*mysql_key_remove)(const char *key_id, const char *user_id); 122 my_bool (*mysql_key_generate)(const char *key_id, const char *key_type, 123 const char *user_id, size_t key_len); 124 void (*mysql_key_iterator_init)(void** key_iterator); 125 void (*mysql_key_iterator_deinit)(void* key_iterator); 126 bool (*mysql_key_iterator_get_key)(void* key_iterator, char *key_id, char *user_id); 127}; 128