diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
commit | 3f619478f796eddbba6e39502fe941b285dd97b1 (patch) | |
tree | e2c7b5777f728320e5b5542b6213fd3591ba51e2 /libmariadb/man/mariadb_field_attr.3 | |
parent | Initial commit. (diff) | |
download | mariadb-3f619478f796eddbba6e39502fe941b285dd97b1.tar.xz mariadb-3f619478f796eddbba6e39502fe941b285dd97b1.zip |
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libmariadb/man/mariadb_field_attr.3')
-rw-r--r-- | libmariadb/man/mariadb_field_attr.3 | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/libmariadb/man/mariadb_field_attr.3 b/libmariadb/man/mariadb_field_attr.3 new file mode 100644 index 00000000..80a2cb8c --- /dev/null +++ b/libmariadb/man/mariadb_field_attr.3 @@ -0,0 +1,92 @@ +.\" Automatically generated by Pandoc 2.5 +.\" +.TH "mariadb_field_attr" "3" "" "Version 3.3.1" "MariaDB Connector/C" +.hy +.SS Name +.PP +mariadb_field_attr \- returns extended metadata information for +pluggable field types +.SS Synopsis +.IP +.nf +\f[C] +#include <mysql.h> + +int *mariadb_field_attr(MARIADB_CONST_STRING *attr, + const MYSQL_FIELD *field, + enum mariadb_field_attr_t type) +\f[R] +.fi +.SS Description +.PP +Returns extended metadata information for pluggable field types like +JSON and GEOMETRY. +.SS Parameter +.IP \[bu] 2 +\f[C]attr\f[R]: A pointer which returns extended metadata information +.IP \[bu] 2 +\f[C]field\f[R]: Specifies the field which contains extended metadata +information +.IP \[bu] 2 +\f[C]type:\f[R] Specifies type of metadata information. +Supported types are \f[C]MARIADB_FIELD_METADATA_DATA_TYPE_NAME\f[R] and +\f[C]MARIADB_FIELD_METADATA_FORMAT_NAME\f[R]. +.SS Return value +.PP +Returns zero on success or non zero if the field doesn\[cq]t provide +extended metadata information. +.SS Notes +.IP \[bu] 2 +Pluggable field type support is available in MariaDB server version +10.5.2 and later +.IP \[bu] 2 +To check if the server supports pluggable field types, check the +extended server capabilities which can be obtained by api function +\f[B]mariadb_get_info(3)\f[R] +.SS Example +.IP +.nf +\f[C] +#include <mysql.h> + +int display_extended_field_attribute(MYSQL *mysql) +{ + MYSQL_RES *result; + MYSQL_FIELD *fields; + + if (mysql_query(mysql, \[dq]CREATE TEMPORARY TABLE t1 (a POINT)\[dq])) + return 1; + + if (mysql_query(mysql, \[dq]SELECT a FROM t1\[dq])) + return 1; + + if (!(result= mysql_store_result(mysql))) + return 1; + + if ((fields= mysql_fetch_fields(result))) + { + MARIADB_CONST_STRING field_attr; + + if (!mariadb_field_attr(&field_attr, &fields[0], + MARIADB_FIELD_ATTR_DATA_TYPE_NAME)) + { + printf(\[dq]Extended field attribute: %s\[rs]n\[dq], field_attr.str); + } + } + mysql_free_result(result); + return 0; +} +\f[R] +.fi +.SS History +.PP +mariadb_field_attr was added in MariaDB Connector/C 3.1.8 +.SS See also +.IP \[bu] 2 +\f[B]mysql_store_result(3)\f[R] +.IP \[bu] 2 +\f[B]mysql_use_result(3)\f[R] +.IP \[bu] 2 +\f[B]mariadb_get_info(3)\f[R] +.IP \[bu] 2 +\f[B]mysql_fetch_fields(3)\f[R] |