summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mysql.h6
-rw-r--r--include/mysql.h.pp2
-rw-r--r--libmysql/CMakeLists.txt3
-rw-r--r--libmysql/libmysql.c17
4 files changed, 28 insertions, 0 deletions
diff --git a/include/mysql.h b/include/mysql.h
index d7fe5edef1e..2f205ec6463 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -854,6 +854,12 @@ my_socket STDCALL mysql_get_socket(const MYSQL *mysql);
unsigned int STDCALL mysql_get_timeout_value(const MYSQL *mysql);
unsigned int STDCALL mysql_get_timeout_value_ms(const MYSQL *mysql);
+/********************************************************************
+ mysql_net_ functions - low-level API to MySQL protocol
+*********************************************************************/
+unsigned long STDCALL mysql_net_read_packet(MYSQL *mysql);
+unsigned long STDCALL mysql_net_field_length(unsigned char **packet);
+
/* status return codes */
#define MYSQL_NO_DATA 100
#define MYSQL_DATA_TRUNCATED 101
diff --git a/include/mysql.h.pp b/include/mysql.h.pp
index b7b1ea2d96d..f6be582c0da 100644
--- a/include/mysql.h.pp
+++ b/include/mysql.h.pp
@@ -732,3 +732,5 @@ int mysql_close_cont(MYSQL *sock, int status);
my_socket mysql_get_socket(const MYSQL *mysql);
unsigned int mysql_get_timeout_value(const MYSQL *mysql);
unsigned int mysql_get_timeout_value_ms(const MYSQL *mysql);
+unsigned long mysql_net_read_packet(MYSQL *mysql);
+unsigned long mysql_net_field_length(unsigned char **packet);
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index ca5d1ec8947..4ce4ab02e6d 100644
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -238,6 +238,9 @@ dynamic_column_get
dynamic_column_prepare_decimal
#
mariadb_deinitialize_ssl
+# low-level API to MySQL protocol
+mysql_net_read_packet
+mysql_net_field_length
)
SET(CLIENT_API_FUNCTIONS
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index df18d6d60da..1df5f0b6d2c 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -4897,3 +4897,20 @@ my_bool STDCALL mysql_read_query_result(MYSQL *mysql)
return (*mysql->methods->read_query_result)(mysql);
}
+/********************************************************************
+ mysql_net_ functions - low-level API to MySQL protocol
+*********************************************************************/
+#if MYSQL_VERSION_ID > 100100
+#error remove these wrappers in 10.1, rename functions instead
+#endif
+
+ulong STDCALL mysql_net_read_packet(MYSQL *mysql)
+{
+ return cli_safe_read(mysql);
+}
+
+ulong STDCALL mysql_net_field_length(uchar **packet)
+{
+ return net_field_length(packet);
+}
+