MariaDB Connector/C Data structures

You are viewing an old version of this article. View the current version here.

This chapter describes the public data structures used by MariaDB Connector/C

MYSQL

The MYSQL structure represents one database connection and is used by most of MariaDB Connector/C's API functions. The MYSQL structure needs to be allocated and initialized by mysql_init() API function.

The MYSQL structure should be considered as opaque, copying or changing values of it's members might end up in unexpected results, errors or program crashes.

MYSQL_RES

The MYSQL_RES structure represents a result set which contains data and meta data information. It will be returned by mysql_use_result(), mysql_store_result() and mysql_stmt_result_metadata() API functions and needs to be released by mysql_free_result().

The MYSQL_RES structure should be considered as opaque, copying or changing values of it's members might end up in unexpected results, errors or program crashes.

MYSQL_STMT

The MYSQL_STMT structure represents a prepared statement handle and is used by MariaDB Connector/C's prepared statemnt API functions. The MYSQL_STMT structure needs to be allocated and initialized by mysql_stmt_init() API function.

The MYSQL_STMT structure should be considered as opaque, copying or changing values of it's members might end up in unexpected results, errors or program crashes.

MYSQL_FIELD

The MYSQL_FIELD structure describes the meta data of a column. It has the following members:

char *nameThe name of the column
unsigned intname_lengthThe length of column name
char *org_name The original name of the column
unsigned intorg_name_lengthThe length of original column name
char *tableThe name of the table
unsigned inttable_lengthThe length of table name
char *org_table The original name of the table
unsigned intorg_table_lengthThe length of original table name
char *db The name of the database (schema)
unsigned intdb_lengthThe length of database name
char *catalogThe catalog name (always 'def')
unsigned intcatalog_lengthThe length of catalog name
char *defdefault value
unsigned intdef_lengthThe length of default value
unsigned intlengthThe length (width) of the column definition
unsigned intmax_lengthThe maximum length of the column value
unsigned intflagsFlags
unsigned intdecinalsNumber of decimals
enum enum_field_typestypeField type

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.