plugin_keyring.h.pp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #include "plugin.h"
  2. typedef void * MYSQL_PLUGIN;
  3. struct st_mysql_xid {
  4. long formatID;
  5. long gtrid_length;
  6. long bqual_length;
  7. char data[128];
  8. };
  9. typedef struct st_mysql_xid MYSQL_XID;
  10. enum 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. };
  19. enum enum_mysql_show_scope
  20. {
  21. SHOW_SCOPE_UNDEF,
  22. SHOW_SCOPE_GLOBAL
  23. };
  24. struct 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. };
  31. typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *);
  32. struct st_mysql_sys_var;
  33. struct st_mysql_value;
  34. typedef int (*mysql_var_check_func)(void* thd,
  35. struct st_mysql_sys_var *var,
  36. void *save, struct st_mysql_value *value);
  37. typedef void (*mysql_var_update_func)(void* thd,
  38. struct st_mysql_sys_var *var,
  39. void *var_ptr, const void *save);
  40. struct 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. };
  56. struct st_mysql_daemon
  57. {
  58. int interface_version;
  59. };
  60. struct st_mysql_information_schema
  61. {
  62. int interface_version;
  63. };
  64. struct st_mysql_storage_engine
  65. {
  66. int interface_version;
  67. };
  68. struct handlerton;
  69. struct Mysql_replication {
  70. int interface_version;
  71. };
  72. struct 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. };
  80. int thd_in_lock_tables(const void* thd);
  81. int thd_tablespace_op(const void* thd);
  82. long long thd_test_options(const void* thd, long long test_options);
  83. int thd_sql_command(const void* thd);
  84. const 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);
  88. void **thd_ha_data(const void* thd, const struct handlerton *hton);
  89. void thd_storage_lock_wait(void* thd, long long value);
  90. int thd_tx_isolation(const void* thd);
  91. int thd_tx_is_read_only(const void* thd);
  92. void* thd_tx_arbitrate(void* requestor, void* holder);
  93. int thd_tx_priority(const void* thd);
  94. int thd_tx_is_dd_trx(const void* thd);
  95. char *thd_security_context(void* thd, char *buffer, size_t length,
  96. size_t max_query_len);
  97. void thd_inc_row_count(void* thd);
  98. int thd_allow_batch(void* thd);
  99. void thd_mark_transaction_to_rollback(void* thd, int all);
  100. int mysql_tmpfile(const char *prefix);
  101. int thd_killed(const void* thd);
  102. void thd_set_kill_status(const void* thd);
  103. void thd_binlog_pos(const void* thd,
  104. const char **file_var,
  105. unsigned long long *pos_var);
  106. unsigned long thd_get_thread_id(const void* thd);
  107. void thd_get_xid(const void* thd, MYSQL_XID *xid);
  108. void mysql_query_cache_invalidate4(void* thd,
  109. const char *key, unsigned int key_length,
  110. int using_trx);
  111. void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
  112. void thd_set_ha_data(void* thd, const struct handlerton *hton,
  113. const void *ha_data);
  114. struct 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. };