i am using this C++ code since long time without problems:
MYSQL_ROW row = mysql_fetch_row(m_hRes);
for(UINT nIndex = 0; nIndex < nFieldsCount; nIndex++)
{
MYSQL_FIELD* fls = mysql_fetch_field_direct(m_hRes, nIndex);
SQLType::e_Type eType = static_cast<SQLType::e_Type>(fls->type);
...
after updating the server from mariadb 10.5 to 11.6 fls->type is always 0 (eDecimal) which is definitly wrong in most cases. The value seems not to be written/used anymore. I updated the client dll (libmariadb.dll) as well - no difference. It seems to be a server problem. But i have no idea, why. Is there any setting for this?
i am using this C++ code since long time without problems:
MYSQL_ROW row = mysql_fetch_row(m_hRes);
for(UINT nIndex = 0; nIndex < nFieldsCount; nIndex++)
{
MYSQL_FIELD* fls = mysql_fetch_field_direct(m_hRes, nIndex);
SQLType::e_Type eType = static_cast<SQLType::e_Type>(fls->type);
...
after updating the server from mariadb 10.5 to 11.6 fls->type is always 0 (eDecimal) which is definitly wrong in most cases. The value seems not to be written/used anymore. I updated the client dll (libmariadb.dll) as well - no difference. It seems to be a server problem. But i have no idea, why. Is there any setting for this?
Share Improve this question asked Jan 19 at 15:04 TimmTimm 515 bronze badges 4 |1 Answer
Reset to default 0I switched from the mariadb client lib to boost::mysql and everything is working fine
Thus, the server definitly sends the data !
The client is also checked to be able receive that data because it does with an older server
In boost::mysql i need to set conn->set_meta_mode(mysql::metadata_mode::full);
There might be a similar problem with defaults and switches in mariadb, although the boost switch does not affect only the data type but column names as well...
thanks for all hints. I will try to find the switch or just keep boost
type
is an enum, and then looking to the enum list hereMYSQL_TYPE_DECIMAL
is listed first, so that would be 0? – Paul T. Commented Jan 19 at 21:38i
in the query and returned by 246,MYSQL_TYPE_NEWDECIMAL
. Does themariadb
client with--column-type-info
include different into? Was this a really old table can can you includeSHOW CREATE TABLE
output here along with a reference to the query executed. – danblack Commented Jan 23 at 6:34