Skip to content

Commit

Permalink
MDEV-27295 Backport SQL service, introduced by MDEV-19275.
Browse files Browse the repository at this point in the history
necessary functions added to the SQL SERVICE.
  • Loading branch information
Alexey Botchkov committed Nov 5, 2023
1 parent b080cff commit 910a0dd
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 1 deletion.
9 changes: 9 additions & 0 deletions include/mysql/plugin_audit.h.pp
Expand Up @@ -435,6 +435,15 @@
void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
void (STDCALL *mysql_close_func)(MYSQL *mysql);
int (STDCALL *mysql_options_func)(MYSQL *mysql, enum mysql_option option,
const void *arg);
unsigned long *(STDCALL *mysql_fetch_lengths_func)(MYSQL_RES *res);
int (STDCALL *mysql_set_character_set_func)(MYSQL *mysql, const char *cs_name);
unsigned int (STDCALL *mysql_num_fields_func)(MYSQL_RES *res);
int (STDCALL *mysql_select_db_func)(MYSQL *mysql, const char *db);
my_bool (STDCALL *mysql_ssl_set_func)(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
} *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql);
struct st_mysql_xid {
Expand Down
9 changes: 9 additions & 0 deletions include/mysql/plugin_auth.h.pp
Expand Up @@ -435,6 +435,15 @@
void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
void (STDCALL *mysql_close_func)(MYSQL *mysql);
int (STDCALL *mysql_options_func)(MYSQL *mysql, enum mysql_option option,
const void *arg);
unsigned long *(STDCALL *mysql_fetch_lengths_func)(MYSQL_RES *res);
int (STDCALL *mysql_set_character_set_func)(MYSQL *mysql, const char *cs_name);
unsigned int (STDCALL *mysql_num_fields_func)(MYSQL_RES *res);
int (STDCALL *mysql_select_db_func)(MYSQL *mysql, const char *db);
my_bool (STDCALL *mysql_ssl_set_func)(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
} *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql);
struct st_mysql_xid {
Expand Down
9 changes: 9 additions & 0 deletions include/mysql/plugin_encryption.h.pp
Expand Up @@ -435,6 +435,15 @@
void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
void (STDCALL *mysql_close_func)(MYSQL *mysql);
int (STDCALL *mysql_options_func)(MYSQL *mysql, enum mysql_option option,
const void *arg);
unsigned long *(STDCALL *mysql_fetch_lengths_func)(MYSQL_RES *res);
int (STDCALL *mysql_set_character_set_func)(MYSQL *mysql, const char *cs_name);
unsigned int (STDCALL *mysql_num_fields_func)(MYSQL_RES *res);
int (STDCALL *mysql_select_db_func)(MYSQL *mysql, const char *db);
my_bool (STDCALL *mysql_ssl_set_func)(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
} *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql);
struct st_mysql_xid {
Expand Down
9 changes: 9 additions & 0 deletions include/mysql/plugin_ftparser.h.pp
Expand Up @@ -435,6 +435,15 @@
void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
void (STDCALL *mysql_close_func)(MYSQL *mysql);
int (STDCALL *mysql_options_func)(MYSQL *mysql, enum mysql_option option,
const void *arg);
unsigned long *(STDCALL *mysql_fetch_lengths_func)(MYSQL_RES *res);
int (STDCALL *mysql_set_character_set_func)(MYSQL *mysql, const char *cs_name);
unsigned int (STDCALL *mysql_num_fields_func)(MYSQL_RES *res);
int (STDCALL *mysql_select_db_func)(MYSQL *mysql, const char *db);
my_bool (STDCALL *mysql_ssl_set_func)(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
} *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql);
struct st_mysql_xid {
Expand Down
9 changes: 9 additions & 0 deletions include/mysql/plugin_password_validation.h.pp
Expand Up @@ -435,6 +435,15 @@
void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
void (STDCALL *mysql_close_func)(MYSQL *mysql);
int (STDCALL *mysql_options_func)(MYSQL *mysql, enum mysql_option option,
const void *arg);
unsigned long *(STDCALL *mysql_fetch_lengths_func)(MYSQL_RES *res);
int (STDCALL *mysql_set_character_set_func)(MYSQL *mysql, const char *cs_name);
unsigned int (STDCALL *mysql_num_fields_func)(MYSQL_RES *res);
int (STDCALL *mysql_select_db_func)(MYSQL *mysql, const char *db);
my_bool (STDCALL *mysql_ssl_set_func)(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
} *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql);
struct st_mysql_xid {
Expand Down
17 changes: 16 additions & 1 deletion include/mysql/service_sql.h
Expand Up @@ -62,6 +62,15 @@ extern struct sql_service_st {
void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
void (STDCALL *mysql_close_func)(MYSQL *mysql);
int (STDCALL *mysql_options_func)(MYSQL *mysql, enum mysql_option option,
const void *arg);
unsigned long *(STDCALL *mysql_fetch_lengths_func)(MYSQL_RES *res);
int (STDCALL *mysql_set_character_set_func)(MYSQL *mysql, const char *cs_name);
unsigned int (STDCALL *mysql_num_fields_func)(MYSQL_RES *res);
int (STDCALL *mysql_select_db_func)(MYSQL *mysql, const char *db);
my_bool (STDCALL *mysql_ssl_set_func)(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath, const char *cipher);
} *sql_service;

#ifdef MYSQL_DYNAMIC_PLUGIN
Expand All @@ -78,6 +87,12 @@ extern struct sql_service_st {
#define mysql_free_result(R) sql_service->mysql_free_result_func(R)
#define mysql_fetch_row(R) sql_service->mysql_fetch_row_func(R)
#define mysql_close(M) sql_service->mysql_close_func(M)
#define mysql_options(M,O,V) sql_service->mysql_options_func(M,O,V)
#define mysql_fetch_lengths(R) sql_service->mysql_fetch_lengths_func(R)
#define mysql_set_character_set(M,C) sql_service->mysql_set_character_set_func(M,C)
#define mysql_num_fields(R) sql_service->mysql_num_fields_func(R)
#define mysql_select_db(M,D) sql_service->mysql_select_db_func(M,D)
#define mysql_ssl_set(M,K,C,A,P,H) sql_service->mysql_ssl_set_func(M,K,C,A,P,H)

#else

Expand All @@ -90,7 +105,7 @@ extern struct sql_service_st {
*/
MYSQL *mysql_real_connect_local(MYSQL *mysql);

/* The rest of the function declarations mest be taken from the mysql.h */
/* The rest of the function declarations must be taken from the mysql.h */

#endif /*MYSQL_DYNAMIC_PLUGIN*/

Expand Down
6 changes: 6 additions & 0 deletions sql/sql_plugin_services.inl
Expand Up @@ -236,6 +236,12 @@ struct sql_service_st sql_service_handler=
mysql_free_result,
mysql_fetch_row,
mysql_close,
mysql_options,
mysql_fetch_lengths,
mysql_set_character_set,
mysql_num_fields,
mysql_select_db,
mysql_ssl_set
};

static struct st_service_ref list_of_services[]=
Expand Down

0 comments on commit 910a0dd

Please sign in to comment.