com_data.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License, version 2.0,
  4. as published by the Free Software Foundation.
  5. This program is also distributed with certain software (including
  6. but not limited to OpenSSL) that is licensed under separate terms,
  7. as designated in a particular file or component or in included license
  8. documentation. The authors of MySQL hereby grant you an additional
  9. permission to link the program and your derivative works with the
  10. separately licensed software that they have included with MySQL.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License, version 2.0, for more details.
  15. You should have received a copy of the GNU General Public License along
  16. with this program; if not, write to the Free Software Foundation, Inc., 51
  17. Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
  18. #ifndef PLUGIN_PROTOCOL_INCLUDED
  19. #define PLUGIN_PROTOCOL_INCLUDED
  20. #ifndef MYSQL_ABI_CHECK
  21. #include "my_global.h" /* Needed for my_bool in mysql_com.h */
  22. #include "mysql_com.h" /* mysql_enum_shutdown_level */
  23. #endif
  24. /**
  25. @file
  26. Definition of COM_DATA to be used with the Command service as data input
  27. structure.
  28. */
  29. typedef struct st_com_init_db_data
  30. {
  31. const char *db_name;
  32. unsigned long length;
  33. } COM_INIT_DB_DATA;
  34. typedef struct st_com_refresh_data
  35. {
  36. unsigned char options;
  37. } COM_REFRESH_DATA;
  38. typedef struct st_com_shutdown_data
  39. {
  40. enum mysql_enum_shutdown_level level;
  41. } COM_SHUTDOWN_DATA;
  42. typedef struct st_com_kill_data
  43. {
  44. unsigned long id;
  45. } COM_KILL_DATA;
  46. typedef struct st_com_set_option_data
  47. {
  48. unsigned int opt_command;
  49. } COM_SET_OPTION_DATA;
  50. typedef struct st_com_stmt_execute_data
  51. {
  52. unsigned long stmt_id;
  53. unsigned long flags;
  54. unsigned char *params;
  55. unsigned long params_length;
  56. } COM_STMT_EXECUTE_DATA;
  57. typedef struct st_com_stmt_fetch_data
  58. {
  59. unsigned long stmt_id;
  60. unsigned long num_rows;
  61. } COM_STMT_FETCH_DATA;
  62. typedef struct st_com_stmt_send_long_data_data
  63. {
  64. unsigned long stmt_id;
  65. unsigned int param_number;
  66. unsigned char *longdata;
  67. unsigned long length;
  68. } COM_STMT_SEND_LONG_DATA_DATA;
  69. typedef struct st_com_stmt_prepare_data
  70. {
  71. const char *query;
  72. unsigned int length;
  73. } COM_STMT_PREPARE_DATA;
  74. typedef struct st_stmt_close_data
  75. {
  76. unsigned int stmt_id;
  77. } COM_STMT_CLOSE_DATA;
  78. typedef struct st_com_stmt_reset_data
  79. {
  80. unsigned int stmt_id;
  81. } COM_STMT_RESET_DATA;
  82. typedef struct st_com_query_data
  83. {
  84. const char *query;
  85. unsigned int length;
  86. } COM_QUERY_DATA;
  87. typedef struct st_com_field_list_data
  88. {
  89. unsigned char *table_name;
  90. unsigned int table_name_length;
  91. const unsigned char *query;
  92. unsigned int query_length;
  93. } COM_FIELD_LIST_DATA;
  94. union COM_DATA {
  95. COM_INIT_DB_DATA com_init_db;
  96. COM_REFRESH_DATA com_refresh;
  97. COM_SHUTDOWN_DATA com_shutdown;
  98. COM_KILL_DATA com_kill;
  99. COM_SET_OPTION_DATA com_set_option;
  100. COM_STMT_EXECUTE_DATA com_stmt_execute;
  101. COM_STMT_FETCH_DATA com_stmt_fetch;
  102. COM_STMT_SEND_LONG_DATA_DATA com_stmt_send_long_data;
  103. COM_STMT_PREPARE_DATA com_stmt_prepare;
  104. COM_STMT_CLOSE_DATA com_stmt_close;
  105. COM_STMT_RESET_DATA com_stmt_reset;
  106. COM_QUERY_DATA com_query;
  107. COM_FIELD_LIST_DATA com_field_list;
  108. };
  109. #endif /* PLUGIN_PROTOCOL_INCLUDED */