Commit 910a0ddd authored by Alexey Botchkov's avatar Alexey Botchkov

MDEV-27295 Backport SQL service, introduced by MDEV-19275.

necessary functions added to the SQL SERVICE.
parent b080cff3
...@@ -435,6 +435,15 @@ extern struct sql_service_st { ...@@ -435,6 +435,15 @@ extern struct sql_service_st {
void (STDCALL *mysql_free_result_func)(MYSQL_RES *result); void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result); MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
void (STDCALL *mysql_close_func)(MYSQL *mysql); 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; } *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql); MYSQL *mysql_real_connect_local(MYSQL *mysql);
struct st_mysql_xid { struct st_mysql_xid {
......
...@@ -435,6 +435,15 @@ extern struct sql_service_st { ...@@ -435,6 +435,15 @@ extern struct sql_service_st {
void (STDCALL *mysql_free_result_func)(MYSQL_RES *result); void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result); MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
void (STDCALL *mysql_close_func)(MYSQL *mysql); 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; } *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql); MYSQL *mysql_real_connect_local(MYSQL *mysql);
struct st_mysql_xid { struct st_mysql_xid {
......
...@@ -435,6 +435,15 @@ extern struct sql_service_st { ...@@ -435,6 +435,15 @@ extern struct sql_service_st {
void (STDCALL *mysql_free_result_func)(MYSQL_RES *result); void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result); MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
void (STDCALL *mysql_close_func)(MYSQL *mysql); 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; } *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql); MYSQL *mysql_real_connect_local(MYSQL *mysql);
struct st_mysql_xid { struct st_mysql_xid {
......
...@@ -435,6 +435,15 @@ extern struct sql_service_st { ...@@ -435,6 +435,15 @@ extern struct sql_service_st {
void (STDCALL *mysql_free_result_func)(MYSQL_RES *result); void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result); MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
void (STDCALL *mysql_close_func)(MYSQL *mysql); 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; } *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql); MYSQL *mysql_real_connect_local(MYSQL *mysql);
struct st_mysql_xid { struct st_mysql_xid {
......
...@@ -435,6 +435,15 @@ extern struct sql_service_st { ...@@ -435,6 +435,15 @@ extern struct sql_service_st {
void (STDCALL *mysql_free_result_func)(MYSQL_RES *result); void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result); MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
void (STDCALL *mysql_close_func)(MYSQL *mysql); 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; } *sql_service;
MYSQL *mysql_real_connect_local(MYSQL *mysql); MYSQL *mysql_real_connect_local(MYSQL *mysql);
struct st_mysql_xid { struct st_mysql_xid {
......
...@@ -62,6 +62,15 @@ extern struct sql_service_st { ...@@ -62,6 +62,15 @@ extern struct sql_service_st {
void (STDCALL *mysql_free_result_func)(MYSQL_RES *result); void (STDCALL *mysql_free_result_func)(MYSQL_RES *result);
MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result); MYSQL_ROW (STDCALL *mysql_fetch_row_func)(MYSQL_RES *result);
void (STDCALL *mysql_close_func)(MYSQL *mysql); 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; } *sql_service;
#ifdef MYSQL_DYNAMIC_PLUGIN #ifdef MYSQL_DYNAMIC_PLUGIN
...@@ -78,6 +87,12 @@ extern struct sql_service_st { ...@@ -78,6 +87,12 @@ extern struct sql_service_st {
#define mysql_free_result(R) sql_service->mysql_free_result_func(R) #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_fetch_row(R) sql_service->mysql_fetch_row_func(R)
#define mysql_close(M) sql_service->mysql_close_func(M) #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 #else
...@@ -90,7 +105,7 @@ extern struct sql_service_st { ...@@ -90,7 +105,7 @@ extern struct sql_service_st {
*/ */
MYSQL *mysql_real_connect_local(MYSQL *mysql); 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*/ #endif /*MYSQL_DYNAMIC_PLUGIN*/
......
...@@ -236,6 +236,12 @@ struct sql_service_st sql_service_handler= ...@@ -236,6 +236,12 @@ struct sql_service_st sql_service_handler=
mysql_free_result, mysql_free_result,
mysql_fetch_row, mysql_fetch_row,
mysql_close, 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[]= static struct st_service_ref list_of_services[]=
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment