Bug #108965 c++ connector error
Submitted: 2 Nov 2022 8:20 Modified: 2 Dec 2022 14:07
Reporter: js yan Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:latest OS:Windows (10)
Assigned to: CPU Architecture:x86 (-64)

[2 Nov 2022 8:20] js yan
Description:
when creating session by Session sess()in mysqlx/xdevapi.h, it throw error CDK Error: Failed string conversion.

How to repeat:
just create session like
const char   *url = ("mysqlx://root@127.0.0.1");
Session sess(url);
[2 Nov 2022 14:07] MySQL Verification Team
Hi Mr. van,

Thank you for your bug report.

However, you have not provided a full description of your bug.

If you are using C++, model your code on our example from the Manual, like this:

-----------------------------------------------

#include <mysqlx/xdevapi.h>

// Scope controls life-time of objects such as session or schema

{
  Session sess("localhost", 33060, "user", "password");
  Schema db= sess.getSchema("test");
  // or Schema db(sess, "test");

  Collection myColl = db.getCollection("my_collection");
  // or Collection myColl(db, "my_collection");

  DocResult myDocs = myColl.find("name like :param")
                           .limit(1)
                           .bind("param","L%").execute();

  cout << myDocs.fetchOne();
}

--------------------------------------------------------------------
[3 Dec 2022 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".