MySQL Blog Archive
For the latest blogs go to blogs.oracle.com/mysql
MySQL Connector/C++ 8.0.6-dmr has been released

Dear MySQL users,

MySQL Connector/C++ 8.0.6-dmr is the next development milestone release
(dmr) of the MySQL Connector/C++ 8.0 series.

Connector/C++ 8.0 can be used to access MySQL implementing Document
Store or in a traditional way, using SQL queries. It allows writing
both C++ applications using X DevAPI or plain C applications using
XAPI.

To learn more about how to write applications using X DevAPI, see
“X DevAPI User Guide”

https://dev.mysql.com/doc/x-devapi-userguide/en/

and “X DevAPI Reference” at

https://dev.mysql.com/doc/dev/connector-cpp/devapi_ref.html

For more information about using plain C XAPI see “XAPI Reference” at

https://dev.mysql.com/doc/dev/connector-cpp/xapi_ref.html

For generic information on using Connector/C++ 8.0, see

https://dev.mysql.com/doc/dev/connector-cpp/

Note

Connector/C++ 8.0 requires MySQL Server version 5.7.12 or higher with
X Plugin enabled. For general documentation about how to get started
using MySQL as a document store, see “Using MySQL as a Document Store”

https://dev.mysql.com/doc/refman/5.7/en/document-store.html

To download MySQL Connector/C++ 8.0.6-dmr, see the “Development Releases”
tab at

https://dev.mysql.com/downloads/connector/cpp/



Changes in MySQL Connector/C++ 8.0.6-dmr (2017-09-28, Development
Milestone)

   Functionality Added or Changed

     * A session now can acquire a lock for documents or rows
       returned by find or select statements, to prevent the
       returned values from being changed from other sessions
       while the lock is held (provided that appropriate
       isolation levels are used). Locks can be requested
       several times for a given find or select statement. Only
       the final request is acted upon. An acquired lock is held
       until the end of the current transaction.
       For X DevAPI, CollectionFind and TableSelect implement
       .lockExclusive() and .lockShared() methods, which request
       exclusive or shared locks, respectively, on returned
       documents or rows. These methods can be called after
       .bind() and before the final .execute().
       For XAPI, the new mysqlx_set_locking(stmt, lock) function
       can be called to request exclusive or shared locks on
       returned documents or rows, or to release locks. The lock
       parameter can be ROW_LOCK_EXCLUSIVE, ROW_LOCK_SHARED, or
       ROW_LOCK_NONE. The first two values specify a type of
       lock to be acquired. ROW_LOCK_NONE removes any row
       locking request from the statement.

     * For X DevAPI, a new auth option can be specified in
       connection strings or URIs to indicate the authentiation
       mechanism. Permitted values are PLAIN and MYSQL41. The
       option name and value are not case sensitive. The
       SessionSettings::Options object supports a new AUTH
       enumeration, with the same permitted values.
       For XAPI, a new auth setting can be specified in
       connection strings or URIs to indicate the authentiation
       mechanism. Permitted values are PLAIN and MYSQL41. The
       option name and value are not case sensitive. A new
       MYSQLX_OPT_AUTH constant is recognized by the
       mysqlx_options_set() function, with permitted values
       MYSQLX_AUTH_PLAIN and MYSQLX_AUTH_MYSQL41.
       If the authentication mechanism is not specified, it
       defaults to PLAIN for secure (TLS) connections, or
       MYSQL41 for insecure connections. For Unix socket
       connections, the default is PLAIN.

     * These drop API changes were made:

          + Session::dropTable(schema, table) and
            Session::dropCollection(schema, coll) were replaced
            by Schema::dropTable(table) and
            Schema::dropCollection(coll), respectively.

          + Schema::dropView() is now a direct-execute method
            returning void rather than Executable.

          + All dropXXX() methods succeed if the dropped objects
            do not exist.

     * The following Collection methods were added:
       addOrReplaceOne(), getOne(), replaceOne(), and
       removeOne().
       The addOrReplaceOne() and replaceOne() methods work only
       with MySQL 8.0.3 and higher servers. For older servers,
       they report an error.

     * Boolean expressions used in queries and statements now
       support a variant of the IN operator for which the right
       hand side operand is any expression that evaluates to an
       array or document.
       X DevAPI example:
coll.find("'car' IN $.toys").execute();

       XAPI example:
res = mysqlx_collection_find(coll, "'car' IN $.toys");

       In this form, the IN operator is equivalent to the
       JSON_CONTAINS() SQL function.

     * On Unix and Unix-like systems, Unix domain socket files
       are now supported as a connection transport for X DevAPI
       or XAPI connections. The socket file can be given in a
       connection string or in the session creation options.
       X DevAPI examples:
XSession sess("mysqlx://user:password@(/path/to/mysql.sock)/schema");

XSession sess({ SessionSettings::USER, "user",
SessionSettings::PWD, "password,
SessionSettings::SOCKET, "/path/to/mysql.sock"
SessionSettings::DB, "schema" });

       XAPI examples:
mysqlx_session_t *sess = mysqlx_get_session_from_url(
  "mysqlx://user:password@(/path/to/mysql.sock)/schema",
  err_buf, &err_code
);

mysqlx_opt_type_t *sess_opt = mysqlx_session_option_new();
mysqlx_session_option_set(sess_opt,
  MYSQLX_OPT_SOCKET, "/path/to/mysql.sock",
  MYSQLX_OPT_USER, "user",
  MYSQLX_OPT_PWD, "password",
  MYSQLX_OPT_DB, "schema");

mysqlx_session_t *sess = mysqlx_get_session_from_options(
  sess_opt, err_buf, &err_code
);

   Bugs Fixed

     * Creating a TLS session with only the ssl-ca option
       specified could succeed, although it should fail if
       ssl-mode is not also specified. (Bug #26226502)

     * mysqlx_get_node_session_from_options() could succeed even
       when a preceding mysqlx_session_option_set() failed.
       (Bug #26188740) 


On Behalf of the MySQL/Oracle Release Engineering Team,
Daniel Horecki