MySQL Forums
Forum List  »  Connector/C++

Re: mysql-connector-cpp-8.0.20 CDK Error: Failed string conversion
Posted by: egor s
Date: July 21, 2020 02:14AM

Hi Luis,

I checked my code on debug and release.
I have table with strings(about 100000 rows). And only one symbol make throwing the exeption.

Platform: win10 vs2019 toolkit v141.

Here is some more information:

auto res = session.sql(u8"SELECT '\uff08'").execute(); // this string read with exeption
//auto res = session.sql(u8"SELECT '('").execute(); // behavior is the same like \uff08
//auto res = session.sql(u8"SELECT '\u0041'").execute(); // normal execution without exception. print "A" to output.
try {
auto & column = res.getColumn(0);
std::cout << column.getType() << std::endl; // output "STRING"
std::cout << column.getCharacterSetName() << std::endl; // output "utf8mb4";
auto row = res.fetchOne().get(0); // throw exception here
std::cout << row << std::endl;
catch (std::exception ex) {
std::cout << ex.what() << std::endl; // output: "CDK Error: Failed string conversion";

Options: ReplyQuote

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.