summaryrefslogtreecommitdiff
path: root/libmysqld/libmysql.c
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2020-03-10 16:05:42 +0400
committerAlexander Barkov <bar@mariadb.com>2020-03-10 20:43:32 +0400
commite40858a7bdc65be4386a9e74262731fae964958b (patch)
tree184b48fea049e6e7ca4763480e6d6a7bd1ff9abd /libmysqld/libmysql.c
parent00749980acf617fbc26b5cdaff6e256a673dab76 (diff)
downloadmariadb-git-e40858a7bdc65be4386a9e74262731fae964958b.tar.gz
MDEV-17832 Protocol: extensions for Pluggable types and JSON, GEOMETRY
Diffstat (limited to 'libmysqld/libmysql.c')
-rw-r--r--libmysqld/libmysql.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libmysqld/libmysql.c b/libmysqld/libmysql.c
index 2be94882303..8ede487e413 100644
--- a/libmysqld/libmysql.c
+++ b/libmysqld/libmysql.c
@@ -64,6 +64,7 @@
#include <sql_common.h>
#include "client_settings.h"
+#include "embedded_priv.h"
#undef net_buffer_length
#undef max_allowed_packet
@@ -733,6 +734,26 @@ mysql_fetch_field(MYSQL_RES *result)
/**************************************************************************
+** Return mysql field metadata
+**************************************************************************/
+int STDCALL
+mariadb_field_attr(MARIADB_CONST_STRING *attr,
+ const MYSQL_FIELD *field,
+ enum mariadb_field_attr_t type)
+{
+ MARIADB_FIELD_EXTENSION *ext= (MARIADB_FIELD_EXTENSION*) field->extension;
+ if (!ext || type > MARIADB_FIELD_ATTR_LAST)
+ {
+ static MARIADB_CONST_STRING null_str= {0,0};
+ *attr= null_str;
+ return 1;
+ }
+ *attr= ext->metadata[type];
+ return 0;
+}
+
+
+/**************************************************************************
Move to a specific row and column
**************************************************************************/