diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mysql.h | 26 | ||||
-rw-r--r-- | include/mysql_com.h | 3 | ||||
-rw-r--r-- | include/mysql_embed.h | 4 | ||||
-rw-r--r-- | include/sql_common.h | 5 | ||||
-rw-r--r-- | include/violite.h | 4 |
5 files changed, 32 insertions, 10 deletions
diff --git a/include/mysql.h b/include/mysql.h index 7e472a120b3..255570d3488 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -201,6 +201,7 @@ enum mysql_rpl_type MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN }; +struct st_mysql_methods; #if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY) @@ -247,11 +248,13 @@ typedef struct st_mysql struct st_mysql* last_used_con; LIST *stmts; /* list of all statements */ + const struct st_mysql_methods *methods; #if !defined(CHECK_EMBEDDED_DIFFERENCES) struct st_mysql_res *result; void *thd; unsigned int last_errno; char *last_error; + char sqlstate[SQLSTATE_LENGTH+1]; /* Used by embedded server */ #endif } MYSQL; @@ -378,12 +381,10 @@ MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host, unsigned int port, const char *unix_socket, unsigned long clientflag); -void STDCALL mysql_close(MYSQL *sock); int STDCALL mysql_select_db(MYSQL *mysql, const char *db); int STDCALL mysql_query(MYSQL *mysql, const char *q); int STDCALL mysql_send_query(MYSQL *mysql, const char *q, unsigned long length); -my_bool STDCALL mysql_read_query_result(MYSQL *mysql); int STDCALL mysql_real_query(MYSQL *mysql, const char *q, unsigned long length); /* perform query on master */ @@ -444,8 +445,6 @@ MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild); MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table, const char *wild); MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql); -MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql); -MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql); int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, const char *arg); void STDCALL mysql_free_result(MYSQL_RES *result); @@ -566,6 +565,25 @@ typedef struct st_mysql_stmt } MYSQL_STMT; +#define mysql_close(sock) (*(sock)->methods->close)(sock) +#define mysql_read_query_result(mysql) (*(mysql)->methods->read_query_result)(mysql) +#define mysql_store_result(mysql) (*(mysql)->methods->store_result)(mysql) +#define mysql_use_result(mysql) (*(mysql)->methods->use_result)(mysql) + +typedef struct st_mysql_methods +{ + void STDCALL (*close)(MYSQL *sock); + my_bool STDCALL (*read_query_result)(MYSQL *mysql); + my_bool STDCALL (*advanced_command)(MYSQL *mysql, + enum enum_server_command command, + const char *header, + ulong header_length, + const char *arg, + ulong arg_length, my_bool skip_check); + MYSQL_RES * STDCALL (*store_result)(MYSQL *mysql); + MYSQL_RES * STDCALL (*use_result)(MYSQL *mysql); +} MYSQL_METHODS; + MYSQL_STMT * STDCALL mysql_prepare(MYSQL * mysql, const char *query, unsigned long length); int STDCALL mysql_execute(MYSQL_STMT * stmt); diff --git a/include/mysql_com.h b/include/mysql_com.h index 0624782c075..057045bd5a0 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -232,6 +232,9 @@ void my_net_local_init(NET *net); void net_end(NET *net); void net_clear(NET *net); my_bool net_realloc(NET *net, unsigned long length); + +/*HFTODO - should remove it + */ #ifndef EMBEDDED_LIBRARY my_bool net_flush(NET *net); #else diff --git a/include/mysql_embed.h b/include/mysql_embed.h index d48b0440660..ba71b2e93ea 100644 --- a/include/mysql_embed.h +++ b/include/mysql_embed.h @@ -19,11 +19,13 @@ #ifdef EMBEDDED_LIBRARY /* Things we don't need in the embedded version of MySQL */ +/*HFTODO +#undef HAVE_VIO - if we don't want client in embedded library +*/ #undef HAVE_PSTACK /* No stacktrace */ #undef HAVE_DLOPEN /* No udf functions */ #undef HAVE_OPENSSL -#undef HAVE_VIO #undef HAVE_ISAM #undef HAVE_SMEM /* No shared memory */ diff --git a/include/sql_common.h b/include/sql_common.h index 65283486fb4..11f432fb478 100644 --- a/include/sql_common.h +++ b/include/sql_common.h @@ -27,9 +27,6 @@ my_ulonglong net_field_length_ll(uchar **packet); MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, my_bool default_value, uint server_capabilities); -my_bool advanced_command(MYSQL *mysql, enum enum_server_command command, - const char *header, ulong header_length, - const char *arg, ulong arg_length, my_bool skip_check); void free_rows(MYSQL_DATA *cur); MYSQL_DATA *read_rows (MYSQL *mysql,MYSQL_FIELD *fields, uint field_count); @@ -38,6 +35,8 @@ void fetch_lengths(ulong *to, MYSQL_ROW column, uint field_count); void free_old_query(MYSQL *mysql); void end_server(MYSQL *mysql); my_bool mysql_reconnect(MYSQL *mysql); +void mysql_read_default_options(struct st_mysql_options *options, + const char *filename,const char *group); #ifdef __cplusplus } #endif diff --git a/include/violite.h b/include/violite.h index 3b61fbf344e..eeb2cbd7185 100644 --- a/include/violite.h +++ b/include/violite.h @@ -220,7 +220,8 @@ enum SSL_type }; -#ifndef EMBEDDED_LIBRARY +/* HFTODO - hide this if we don't want client in embedded server + */ /* This structure is for every connection on both sides */ struct st_vio { @@ -263,5 +264,4 @@ struct st_vio #endif /* HAVE_SMEM */ #endif /* HAVE_VIO */ }; -#endif /* EMBEDDED_LIBRARY */ #endif /* vio_violite_h_ */ |