Dear MySQL users,
MySQL Connector/C++ 8.0.23 is a new release version 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++ and plain C applications using X DevAPI and X DevAPI for C.
It also supports the legacy API of Connector/C++ 1.1 based on JDBC4.
To learn more about how to write applications using X DevAPI, see
“X DevAPI User Guide” at
https://dev.mysql.com/doc/x-devapi-userguide/en/
See also “X DevAPI Reference” at
https://dev.mysql.com/doc/dev/connector-cpp/devapi_ref.html
and “X DevAPI for C 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/
For general documentation about how to get started using MySQL
as a document store, see
http://dev.mysql.com/doc/refman/8.0/en/document-store.html
To download MySQL Connector/C++ 8.0.23, see the “General Availability (GA)
Releases” tab at
https://dev.mysql.com/downloads/connector/cpp/
Changes in MySQL Connector/C++ 8.0.23 (2021-01-18, General Availability)
* Legacy (JDBC API) Notes
* Functionality Added or Changed
* Bugs Fixed
Legacy (JDBC API) Notes
* Previously, to build or run applications that use the
legacy JDBC API, it was necessary to have Boost
installed. Boost is no longer required for such
applications. The API has not changed, so no code changes
are required to build applications. However, in
consequence of this change, the ABI version has increased
from 7 to 9. To run applications, a version of
Connector/C++ built with the same ABI must be installed:
+ Applications built using the new ABI require a
version of Connector/C++ also built using the new
ABI.
+ Applications built using the old ABI require a
version of Connector/C++ also built using the old
ABI.
To build the legacy connector itself from source, it is
still necessary to have Boost installed.
Functionality Added or Changed
* All calls that allow a column name, such as findColumn(),
getString(), and getInt(), are now case-sensitive. (Bug
#30126457, Bug #96398)
* The developer documentation was improved regarding how to
decode the bytes received by mysqlx_get_bytes(). Thanks
to Daniël van Eeden for pointing at the missing
documentation. (Bug #29115299, Bug #93641)
* Thanks to Daniël van Eeden, who contributed various
corrections to the developer documentation. (Bug
#29038157, Bug #93549)
* A dependency on the mysql-client-plugins package was
removed. This package now is required only on hosts where
Connector/C++ applications make connections using
commercial MySQL server accounts with LDAP
authentication. In that case, additional libraries must
also be installed: cyrus-sasl-scram for installations
that use RPM packages and libsasl2-modules-gssapi-mit for
installations that use Debian packages. These SASL
packages provide the support required to use the
SCRAM-SHA-256 and GSSAPI/Kerberos authentication methods
for LDAP.
If Connector/C++ applications do not use LDAP
authentication, no additional packages are required.
Bugs Fixed
* Connector/C++ 8.0 RPM packages could not be installed on
a system where MySQL 5.7 RPM packages were installed.
(Bug #32142148)
* Establishing a connection using a ConnectOptionsMap
object could fail due to differences in std::string
implementations. (Bug #32039929)
* Commercial Connector/C++ RPM packages were missing
provides information. (Bug #31775733)
On Behalf of MySQL Release Engineering Team,
Tvarita Jain
Category Archives: Connector/C++
MySQL Connector/C++ 8.0.22 has been released
Dear MySQL users,
MySQL Connector/Node.js is a new Node.js driver for use with the X
DevAPI. This release, v8.0.22, is a maintenance release of the
MySQL Connector/Node.js 8.0 series.
The X DevAPI enables application developers to write code that combines
the strengths of the relational and document models using a modern,
NoSQL-like syntax that does not assume previous experience writing
traditional SQL.
MySQL Connector/Node.js can be downloaded through npm (see
https://www.npmjs.com/package/@mysql/xdevapi for details) or from
https://dev.mysql.com/downloads/connector/nodejs/.
To learn more about how to write applications using the X DevAPI, see
http://dev.mysql.com/doc/x-devapi-userguide/en/.
For more information about how the X DevAPI is implemented in MySQL
Connector/Node.js, and its usage, see
http://dev.mysql.com/doc/dev/connector-nodejs/.
Please note that the X DevAPI requires at least MySQL Server version
8.0 or higher with the X Plugin enabled. For general documentation
about how to get started using MySQL as a document store, see
http://dev.mysql.com/doc/refman/8.0/en/document-store.html.
Changes in MySQL Connector/Node.js 8.0.22 (2020-10-19, General Availability)
Functionality Added or Changed
* Improved test execution configuration to better align
with other connectors. For example, unified environment
variable names (such as changing NODE_TEST_MYSQL_HOST to
MYSQLX_HOST). See the Connector/Node.js documentation
(https://dev.mysql.com/doc/dev/connector-nodejs/8.0/) for
usage information.
Bugs Fixed
* Non-BIGINT values stored in BIGINT columns were not
decoded properly in result sets. (Bug #31686805, Bug
#100324)
* Fetched results from a SET column would only contain one
value from the set. (Bug #31654667, Bug #100255)
* Deprecated the dbPassword and dbUser property names;
which were aliases to the password and user properties.
Their usage now emits deprecation level errors. (Bug
#31599660)
* Added a SERVER_GONE error handler to avoid potential
circular dependency warnings with Node.js >= 14.0.0. (Bug
#31586107, Bug #99869)
* Restricted the offset() method to the CollectionFind and
TableSelect APIs, as described in the X DevAPI
specification. Using offset() on other APIs yielded this
error: “Error: The server has gone away”. Instead, this
intended behavior is available by using a combination of
“sort()” or “orderBy()” and “limit()”. (Bug #31418813)
* The nextResult() method returned false against an empty
result set, and now returns true. Alternatively, use
hasData() to check if a result set has data. (Bug
#31037211)
* The column.getType() method now returns the stringified
type identifier when before it returned its numeric
value. For example, DATETIME is now returned instead of
12. (Bug #30922711)
* Improved memory management for work performed by 3rd
party APIs. (Bug #30845472)
* Added support for lazy decoding of binary column metadata
content. (Bug #30845366) Dear MySQL users,
MySQL Connector/C++ 8.0.22 is a new release version 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++ and plain C applications using X DevAPI and X DevAPI for C.
It also supports the legacy API of Connector/C++ 1.1 based on JDBC4.
To learn more about how to write applications using X DevAPI, see
“X DevAPI User Guide” at
https://dev.mysql.com/doc/x-devapi-userguide/en/
See also “X DevAPI Reference” at
https://dev.mysql.com/doc/dev/connector-cpp/devapi_ref.html
and “X DevAPI for C 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/
For general documentation about how to get started using MySQL
as a document store, see
http://dev.mysql.com/doc/refman/8.0/en/document-store.html
To download MySQL Connector/C++ 8.0.22, see the “General Availability (GA)
Releases” tab at
https://dev.mysql.com/downloads/connector/cpp/
Changes in MySQL Connector/C++ 8.0.22 (2020-10-19, General Availability)
Compilation Notes
* Connector/C++ now can be compiled using MinGW on Windows.
Thanks to Eric Beuque for the contribution. Note that
this enables building on MinGW but does not make MinGW an
officially supported platform for Connector/C++. (Bug
#31636723, Bug #100248)
Connection Management Notes
* For connections made using X Plugin, Connector/C++ now
enables specifying the compression algorithms to be used
for connections that use compression. Connection URIs and
SessionSettings objects permit explicitly specifying the
preferred algorithms:
+ URI strings permit a compression-algorithms option.
The value is an algorithm name, or a list of one or
more comma-separated algorithms specified as an
array. Examples:
mysqlx://user:password@host:port/db?compression-algorithms=lz4
mysqlx://user:password@host:port/db?compression-algorithms=[lz4,zstd_stream]
+ SessionSettings objects permit a
SessionOption::COMPRESSION_ALGORITHMS option. The
value is a list of one or more comma-separated
algorithms. Examples:
mysqlx::Session sess(SessionOption::USER, “user_name”,
SessionOption::PWD, “password”,
SessionOption::COMPRESSION_ALGORITHMS, “lz4”);
mysqlx::Session sess(SessionOption::USER, “user_name”,
SessionOption::PWD, “password”,
SessionOption::COMPRESSION_ALGORITHMS, “lz4,zstd_stream”);
Alternatively, the algorithms value can be given as
a container:
std::list<std::string> algorithms = {“lz4″,”zstd_stream”};
mysqlx::Session sess(SessionOption::USER, “user_name”,
SessionOption::PWD, “password”,
SessionOption::COMPRESSION_ALGORITHMS, algorithms);
+ For X DevAPI for C, there is a new
MYSQLX_OPT_COMPRESSION_ALGORITHMS option and
corresponding OPT_COMPRESSION_ALGORITHMS helper
macro.
URI mode follows X DevAPI URI mode:
mysqlx_session_t *sess = mysqlx_get_session_from_url(
“mysqlx://user:password@host:port/db?compression-algorithms=[lz4,zstd_stream]”, &error);
Option mode follows the string format used for
SessionOption:
mysqlx_session_option_set(opt,
OPT_HOST(“host_name”),
OPT_USER(“user”),
OPT_PWD(“password”),
OPT_COMPRESSION_ALGORITHMS(“lz4,zstd_stream”),
PARAM_END));
These rules apply:
+ Permitted algorithm names are zstd_stream,
lz4_message, and deflate_stream, and their aliases
zstd, lz4, and deflate. Names are case-insensitive.
Unknown names are ignored.
+ Compression algorithms options permit multiple
algorithms, which should be listed in priority
order. Options that specify multiple algorithms can
mix full algorithm names and aliases.
+ If no compression algorithms option is specified,
the default is
zstd_stream,lz4_message,deflate_stream.
+ The actual algorithm used is the first of those
listed in the compression algorithms option that is
also permitted on the server side. However, the
option for compression algorithms is subject to the
compression mode:
o If the compression mode is disabled, the
compression algorithms option is ignored.
o If the compression mode is preferred but no
listed algorithm is permitted on the server
side, the connection is uncompressed.
o If the compression mode is required but no
listed algorithm is permitted on the server
side, an error occurs.
See also Connection Compression with X Plugin
(https://dev.mysql.com/doc/refman/8.0/en/x-plugin-connection-compression.html).
Legacy (JDBC API) Notes
* For applications that use the legacy JDBC API (that is,
not X DevAPI or X DevAPI for C), Connector/C++ binary
distributions now include the libraries that provide the
client-side LDAP authentication plugins, as well as any
dependent libraries required by the plugins. This enables
Connector/C++ application programs to connect to MySQL
servers using simple LDAP authentication, or SASL LDAP
authentication using the SCRAM-SHA-1 authentication
method.
Note
LDAP authentication requires use of a server from a MySQL
Enterprise Edition distribution. For more information
about the LDAP authentication plugins, see LDAP Pluggable
Authentication
(https://dev.mysql.com/doc/refman/8.0/en/ldap-pluggable-authentication.html).
If Connector/C++ was installed from a compressed tar file
or Zip archive, the application program will need to set
the OPT_PLUGIN_DIR connection option to the appropriate
directory so that the bundled plugin library can be
found. (Alternatively, copy the required plugin library
to the default directory expected by the client library.)
Example:
sql::ConnectOptionsMap connection_properties;
// To use simple LDAP authentication …
connection_properties[“userName”] = “simple_ldap_user_name”;
connection_properties[“password”] = “simple_ldap_password”;
connection_properties[OPT_ENABLE_CLEARTEXT_PLUGIN]=true;
// To use SASL LDAP authentication using SCRAM-SHA-1 …
connection_properties[“userName”] = “sasl_ldap_user_name”;
connection_properties[“password”] = “sasl_ldap_scram_password”;
// Needed if Connector/C++ was installed from tar file or Zip archive …
connection_properties[OPT_PLUGIN_DIR] = “${INSTALL_DIR}/lib{64}/plugin”;
auto *driver = get_driver_instance();
auto *con = driver->connect(connection_properties);
// Execute statements …
con->close();
* For applications that use the legacy JDBC API (that is,
not X DevAPI or X DevAPI for C), LOCAL data loading
capability for the LOAD DATA statement previously could
be controlled on the client side only by enabling it for
all files accessible to the client, or by disabling it
altogether. The new OPT_LOAD_DATA_LOCAL_DIR option
enables restricting LOCAL data loading to files located
in a designated directory. For example, to set the value
at connect time:
sql::ConnectOptionsMap opt;
opt[OPT_HOSTNAME] = “localhost”;
opt[OPT_LOAD_DATA_LOCAL_DIR] = “/tmp”;
sql::Connection *conn = driver->connect(opt);
OPT_LOAD_DATA_LOCAL_DIR can also be set after connect
time:
sql::ConnectOptionsMap opt;
opt[OPT_HOSTNAME] = “localhost”;
sql::Connection *conn = driver->connect(opt);
//…. some queries / inserts / updates
std::string path= “/tmp”;
conn->setClientOption(OPT_LOAD_DATA_LOCAL_DIR, path);
// LOAD LOCAL DATA DIR …
//Disable LOCAL INFILE by setting to null
conn->setClientOption(OPT_LOAD_DATA_LOCAL_DIR, nullptr);
The OPT_LOAD_DATA_LOCAL_DIR option maps onto the
MYSQL_OPT_LOAD_DATA_LOCAL_DIR option for the
mysql_options() C API function. For more information, see
Security Considerations for LOAD DATA LOCAL
(https://dev.mysql.com/doc/refman/8.0/en/load-data-local-security.html).
Bugs Fixed
* String decoding failed for utf-8 strings that began with
a \xEF byte-order mark. (Bug #31656092)
* With the CLIENT_MULTI_FLAG option enabled, executing
multiple statements in a batch caused the next query to
fail with a Commands out of sync error. (Bug #31399362)
* For connections made using X Plugin, connections over
Unix socket files did not work. (Bug #31329938)
* For connections made using X Plugin, the default
compression mode was DISABLED rather than PREFERRED. (Bug
#31173447) Dear MySQL users,
MySQL Connector/Node.js is a new Node.js driver for use with the X
DevAPI. This release, v8.0.22, is a maintenance release of the
MySQL Connector/Node.js 8.0 series.
The X DevAPI enables application developers to write code that combines
the strengths of the relational and document models using a modern,
NoSQL-like syntax that does not assume previous experience writing
traditional SQL.
MySQL Connector/Node.js can be downloaded through npm (see
https://www.npmjs.com/package/@mysql/xdevapi for details) or from
https://dev.mysql.com/downloads/connector/nodejs/.
To learn more about how to write applications using the X DevAPI, see
http://dev.mysql.com/doc/x-devapi-userguide/en/.
For more information about how the X DevAPI is implemented in MySQL
Connector/Node.js, and its usage, see
http://dev.mysql.com/doc/dev/connector-nodejs/.
Please note that the X DevAPI requires at least MySQL Server version
8.0 or higher with the X Plugin enabled. For general documentation
about how to get started using MySQL as a document store, see
http://dev.mysql.com/doc/refman/8.0/en/document-store.html.
Changes in MySQL Connector/Node.js 8.0.22 (2020-10-19, General Availability)
Functionality Added or Changed
* Improved test execution configuration to better align
with other connectors. For example, unified environment
variable names (such as changing NODE_TEST_MYSQL_HOST to
MYSQLX_HOST). See the Connector/Node.js documentation
(https://dev.mysql.com/doc/dev/connector-nodejs/8.0/) for
usage information.
Bugs Fixed
* Non-BIGINT values stored in BIGINT columns were not
decoded properly in result sets. (Bug #31686805, Bug
#100324)
* Fetched results from a SET column would only contain one
value from the set. (Bug #31654667, Bug #100255)
* Deprecated the dbPassword and dbUser property names;
which were aliases to the password and user properties.
Their usage now emits deprecation level errors. (Bug
#31599660)
* Added a SERVER_GONE error handler to avoid potential
circular dependency warnings with Node.js >= 14.0.0. (Bug
#31586107, Bug #99869)
* Restricted the offset() method to the CollectionFind and
TableSelect APIs, as described in the X DevAPI
specification. Using offset() on other APIs yielded this
error: “Error: The server has gone away”. Instead, this
intended behavior is available by using a combination of
“sort()” or “orderBy()” and “limit()”. (Bug #31418813)
* The nextResult() method returned false against an empty
result set, and now returns true. Alternatively, use
hasData() to check if a result set has data. (Bug
#31037211)
* The column.getType() method now returns the stringified
type identifier when before it returned its numeric
value. For example, DATETIME is now returned instead of
12. (Bug #30922711)
* Improved memory management for work performed by 3rd
party APIs. (Bug #30845472)
* Added support for lazy decoding of binary column metadata
content. (Bug #30845366)
On Behalf of Oracle/MySQL Release Engineering Team,
Hery Ramilison
MySQL Connector/C++ 8.0.21 has been released
Dear MySQL users,
MySQL Connector/C++ 8.0.21 is a new release version 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++ and plain C applications using X DevAPI and X DevAPI for C.
It also supports the legacy API of Connector/C++ 1.1 based on JDBC4.
To learn more about how to write applications using X DevAPI, see
“X DevAPI User Guide” at
https://dev.mysql.com/doc/x-devapi-userguide/en/
See also “X DevAPI Reference” at
https://dev.mysql.com/doc/dev/connector-cpp/devapi_ref.html
and “X DevAPI for C 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/
For general documentation about how to get started using MySQL
as a document store, see
http://dev.mysql.com/doc/refman/8.0/en/document-store.html
To download MySQL Connector/C++ 8.0.21, see the “General Availability (GA)
Releases” tab at
https://dev.mysql.com/downloads/connector/cpp/
Changes in MySQL Connector/C++ 8.0.21 (2020-07-13, General Availability)
Configuration Notes
* The CMake configuration files were revised to work better
when Connector/C++ is used as a subproject of application
projects. Thanks to Lou Shuai for the contribution.
This revision does not change the fact that the intended
(and supported) usage scenario is to build the connector
in a separate project, install it somewhere and then use
it in application projects from that installed location
(for example, by defining the imported library target in
CMake). (Bug #31095993, Bug #99093)
JSON Notes
* The rapidjson library included with Connector/C++ has
been upgraded to the GitHub snapshot of 16 January 2020.
Security Notes
* For platforms on which OpenSSL libraries are bundled, the
linked OpenSSL library for Connector/C++ has been updated
to version 1.1.1g. Issues fixed in the new OpenSSL
version are described at
https://www.openssl.org/news/cl111.txt and
https://www.openssl.org/news/vulnerabilities.html. (Bug
#31296689)
X DevAPI Notes
* For X DevAPI or X DevAPI for C applications, methods and
functions that create or modify collections now accept
options to enable validation of a JSON schema that
documents must adhere to before they are permitted to be
inserted or updated. Schema validation is performed by
the server, which returns an error message if a document
in a collection does not match the schema definition or
if the server does not support validation.
These new classes are implemented to support validation
options:
+ CollectionOptions: The base class that has all
options. Contains an Option enumeration with
constants REUSE and VALIDATION.
+ CollectionValidation: Handles only subkey
validation. Contains a Level enumeration with
constants STRICT and OFF, and an Option enumeration
with constants SCHEMA and LEVEL.
X DevAPI now has these signatures for createCollection()
(and modifyCollection()):
// Accepts the full document
createCollection(“name”, “JSON_Document”);
// DbDoc usage is also permitted
createCollection(“name”, DbDoc(“validation”, DbDoc(“level”,”off”,…)));
// List of pairs with Option enum constant and value
createCollection(CollectionOptions::REUSE, true,
CollectionOptions::VALIDATION, CollectionValidation(…));
// Old REUSE way is also acceptable
createCollection(“name”, true);
createCollection(“name”, CollectionValidation(…));
// createCollection also allows a list of pairs of
// CollectionValidation Option enum constant and value
createCollection(“name”, CollectionOptions::VALIDATION,
CollectionValidation::OFF,
CollectionValidation::SCHEMA,
“Object”);
X DevAPI for C examples:
These are the possible options for
mysqlx_collection_options_set():
OPT_COLLECTION_VALIDATION_LEVEL(VALIDATION_OFF)
OPT_COLLECTION_VALIDATION_SCHEMA(“Object”)
OPT_COLLECTION_REUSE(true)
Perform option operations like this:
mysqlx_collection_options_t *options = mysqlx_collection_options_new() //creates collection options object
mysqlx_free(options) //frees collection options
mysqlx_collection_options_set(options,…);
Creation and modification functions have these signatures:
mysqlx_collection_create_with_options(mysqlx_schema_t *schema, mysqlx_collection_options_t *options);
mysqlx_collection_create_with_json_options(mysqlx_schema_t *schema, const char* json_options);
mysqlx_collection_modify_with_options(mysqlx_schema_t *schema, mysqlx_collection_options_t *options);
mysqlx_collection_modify_with_json_options(mysqlx_schema_t *schema, const char* json_options);
For modifications, the REUSE option is not supported and
an error occurs if it is used.
Functionality Added or Changed
* The MySQL_Connection_Options enumeration is no longer
sensitive to the order in which the underlying options
are declared in the C API source. (Bug #30799197)
* Connector/C++ now implements blocking of failed
connection-pool endpoints to prevent them from being
reused until a timeout period has elapsed. This should
reduce average wait time for applications to obtain a
connection from the pool in the event that endpoints
become temporarily unavailable.
Bugs Fixed
* For applications that use the legacy JDBC API (that is,
not X DevAPI or X DevAPI for C) on a system that does not
have OpenSSL libraries installed, the libraries that are
bundled with Connector/C++ could not be found when
resolving run-time dependencies of the application. (Bug
#31007317)
* For a reply with multiple result sets (such as the result
from a stored procedure that executed multiple queries),
an error in reply processing logic could incorrectly
deregister the reply object after reading the first
result set while more result sets from the server were
pending, resulting in an application error. (Bug
#30989042)
On Behalf of Oracle/MySQL Release Engineering Team,
Hery Ramilison
MySQL Connector/C++ 1.1.13 has been released
Dear MySQL Users,
MySQL Connector/C++ 1.1.13 is a new release version of the MySQL
Connector/C++ 1.1 series.
Connector/C++ 1.1 can be used to access MySQL using an API
based on JDBC4.
For information on using Connector/C++ 1.1, see
https://dev.mysql.com/doc/connector-cpp/1.1/en/
To download MySQL Connector/C++ 1.1.13, see the “General
Availability (GA) Releases” tab at
http://dev.mysql.com/downloads/connector/cpp/1.1.html
MySQL Connector C++ (Commercial) will be available for download on the
My Oracle Support (MOS) website. This release will be available on
eDelivery (OSDC) in next month’s upload cycle.
Connector/C++ 1.1 offers an easy to use API derived from JDBC 4.0.
Enjoy!
Changes in MySQL Connector/C++ 1.1.13 (2019-10-25, General
Availability)
Character Set Support
* Connector/C++ now supports the utf8mb4_0900_bin collation
added for the utf8mb4 Unicode character set in MySQL
8.0.17. For more information about this collation, see
Unicode Character Sets
(https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-sets.html).
Bugs Fixed
* Connector/C++ set the transaction isolation level to
REPEATABLE READ at connect time, regardless of the
current server setting. (Bug #22038313, Bug #78852, Bug
#30294415)
On Behalf of MySQL/ORACLE RE Team
Gipson Pulla