MySQL Forums
Forum List  »  Connector/C++

Automatic Casting to Types not working
Posted by: Almog Hamdani
Date: July 03, 2019 08:02AM


I recently upgraded my MySQL Connector C++ to v8.0.16 which lead to problem occurring during the compile of my project.

All the errors are from casting the "mysql::abi2::r0::Value" to different types.
For example, I have this code inside one of my functions:

std::string s;
sql::Row res;

... Fetching from database ...

s = row[0]; // Here is the error

The error I'm having is:

no suitable user-defined conversion from "mysqlx::abi2::r0::Value" to "std::string" exists

But if I use casting it works:

s = (std::string)row[0]; // No error here

In the previous version of MySQL Connector C++ I didn't have this problem.

My question is this is a problem with MySQL Connector or it's a problem with my project?

Thanks in advance!

Options: ReplyQuote

Written By
Automatic Casting to Types not working
July 03, 2019 08:02AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.