← Back to team overview

maria-discuss team mailing list archive

Connector/C Types and Definitions vs Data Types in MariaDB

 

Hi,

As a little learning project I want to program a test case to insert some rows in a table, using MariaDB Connector/C API Prepared Statement . <https://mariadb.com/kb/en/mariadb-connectorc-api-prepared-statement-functions/> That table has column definitions adhering to the MariaDB Data Types, as described in https://mariadb.com/kb/en/data-types/

Following the example given in https://mariadb.com/kb/en/bulk-insert-row-wise-binding/, I want to set the buffer and buffer_type values of the MSQL_BIND struct.

But I'm somewhat at a loss here, because the before mentioned datatypes described in https://mariadb.com/kb/en/data-types/ do not always match with the Connector/C Types and Definitions given in https://mariadb.com/kb/en/connectorc-types-and-definitions/

For example, the latter has MYSQL_TYPE_INT24, which is not present in the former. Field types are defined in mariadb_com.h, but the size and the value ranges are not given there, nor at https://mariadb.com/kb/en/connectorc-types-and-definitions/

Hence, especially for the types present in only the list in Connector/C Types and Definitions, I don't know their size and value, and how to connect them to he gcc types.

Anyone here who can guide me on this?

cheers, Jogchum