admin管理员组文章数量:1207155
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
本文标签:
版权声明:本文标题:c++ - mysql_fetch_field_direct does not return type of data anymore since updating server from mariadb 10.5 to 11.6 - Stack Over 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738734661a2109527.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
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