MySQL Connector/J 8.0.21 has been released

Dear MySQL users,

MySQL Connector/J 8.0.21 is the latest General Availability release of
the MySQL Connector/J 8.0 series.  It is suitable for use with MySQL
Server versions 8.0, 5.7, and 5.6.  It supports the Java Database
Connectivity (JDBC) 4.2 API, and implements the X DevAPI.

In the documentation for MySQL 8.0.21, we have started
changing the term “master” to “source”, the term “slave” to
“replica”, the term “whitelist” to “allowlist”, and the term
“blacklist” to “blocklist”. There are currently no changes to
the product’s syntax, so these terms are still present in the
documentation where the current code requires their use. See
the blog post MySQL Terminology Updates
(https://mysqlhighavailability.com/mysql-terminology-updates/)
for more information.

This release includes the following new features and changes, also
described in more detail on

https://dev.mysql.com/doc/relnotes/connector-j/8.0/en/news-8-0-21.html

As always, we recommend that you check the “CHANGES” file in the
download archive to be aware of changes in behavior that might affect
your application.

To download MySQL Connector/J 8.0.21 GA, see the “General Availability
(GA) Releases” tab at http://dev.mysql.com/downloads/connector/j/

Enjoy!

Changes in MySQL Connector/J 8.0.21 (2020-07-13, General Availability)

* Functionality Added or Changed

* Bugs Fixed Functionality Added or Changed

Functionality Added or Changed

* X DevAPI: The JSON Schema Validation Functions (https://dev.mysql.com/doc/refman/8.0/en/json-validation-functions.html)
on MySQL servers are now supported by
Connector/J; see Schema Validation for details.

* The required versions of the 3rd-party libraries needed
for running or compiling Connector/J have been changed;
new requirements for additional libraries have also been
added. See Installing Connector/J from a Binary
Distribution
(https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-binary-installation.html)
and Installing from Source
(https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-installing-source.html) for details.

Bugs Fixed

* When trying to set a parameter for a PreparedStatement
using the method
PreparedStatement.setObject(parameterIndex, “false”,
Types.BOOLEAN), the value was set to true instead of
false. (Bug #30911870, Bug #98237)

On Behalf of MySQL Release Engineering Team,
Surabhi Bhat




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/ODBC 8.0.21 has been released

Dear MySQL users,

MySQL Connector/ODBC 8.0.21 is a new version in the MySQL Connector/ODBC
8.0 series, the ODBC driver for the MySQL Server.

The available downloads include both a Unicode driver and an ANSI driver
based on the same modern codebase. Please select the driver type you
need based on the type of your application – Unicode or ANSI.
Server-side prepared statements are enabled by default.  It is suitable
for use with the latest MySQL server version 8.0.

This release of the MySQL ODBC driver is conforming to the ODBC 3.8
specification.  It contains implementations of key 3.8 features,
including self-identification as a ODBC 3.8 driver, streaming of out for
binary types only), and support of the SQL_ATTR_RESET_CONNECTION
connection attribute (for the Unicode driver only).

The release is now available in source and binary form for a number of
platforms from our download pages at

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

For information on installing, please see the documentation at

https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-installation.html

Enjoy and thanks for the support!

==============================================================================

Changes in MySQL Connector/ODBC 8.0.21 (2020-07-13, General Availability)


     * Security Notes

     * Bugs Fixed

Security Notes


     * For platforms on which OpenSSL libraries are bundled, the
       linked OpenSSL library for Connector/ODBC 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#31296688)

Bugs Fixed


     * The MSI installer now checks for the Visual 2019 C++
       runtime, and aborts if this required runtime is not
       installed.
        This is also the first version that requires Visual 2019
        C++ runtime, when before the 2017 version was also
        supported. (Bug #31102234)

     * Only a single value was being inserted instead of the
        array, with SQLParamOptions. (Bug #30591722)

     * The SUM aggregate function did not function with ADO.
       (Bug #30277891, Bug #96642)

     * Added a workaround to account for a limitation in the
       iODBC SQLGetPrivateProfileString() implementation as
       previously DSN options could be lost. iODBC is most
       commonly used on macOS. (Bug #27851681)


On Behalf of Oracle/MySQL Engineering Team
Prashant Tekriwal

MySQL Connector/Python 8.0.21 has been released

Dear MySQL users,

MySQL Connector/Python 8.0.21 is the latest GA release version of the
MySQL Connector Python 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.

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/Python, and its usage, see

http://dev.mysql.com/doc/dev/connector-python

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

To download MySQL Connector/Python 8.0.21, see the “General Availability
(GA) Releases” tab at

http://dev.mysql.com/downloads/connector/python/

Enjoy!

Changes in MySQL Connector/Python 8.0.21 (2020-07-13, General Availability)

Functionality Added or Changed

* Implemented context managers to define the runtime
context to establish when executing a with statement. It
was added to the Connection and Cursor objects in the
classic protocol, and to Session in the X DevAPI. Thanks
to WEN-FENG SHIH for the patch. (Bug #19586444, Bug
#71663, Bug #28779784, Bug #89113)

* Added compression support to X Protocol connections.
Supported compression algorithms are zlib/deflate and
lz4. Specifically, the supported algorithms (in order of
preference) are lz4_message and deflate_stream. The
compression threshold is set at 1000 bytes.
A new compress X DevAPI connection option accepts either
required, disabled, or preferred (default).

+ preferred: If Connector/Python and the server cannot
reach consensus on algorithm or styles, then no
compression is used; and this is logged.

+ required: Like preferred, except the connection is
terminated with an error if the connector and server
are unable to reach agreement.

+ disabled: Compression is not used.

Bugs Fixed

* The connect_timeout option applied to all blocking socket
operations but now properly only applies to the timeout
when establishing the connection. (Bug #30996790)

* In X DevAPI implementation, an error was raised when
using the fractional part in DATETIME types. The error:
“ValueError: Datetime mapping scenario unhandled” (Bug
#30950184)

* Because MySQL stores TEXT types as BLOB and JSON as
LONGBLOB, the TEXT and JSON types are now converted to
str and the rest of the BLOB types as bytes. Previously,
as an example, a column of type TEXT that only contained
digits was read as type=integer by Connector/Python. (Bug
#29808262, Bug #95437)

* Connector/Python assumed that MySQL libraries were under
lib/ when compiling the C extension, but now uses the
mysql_config flags which adds the correct include and
libraries paths. Thanks to Daniël van Eeden for the
patch. (Bug #29181907, Bug #93846)

On Behalf of Oracle/MySQL Engineering Team,
Balasubramanian Kandasamy

MySQL Connector/Python 8.0.20 has been released

Dear MySQL users,

MySQL Connector/Python 8.0.20 is the latest GA release version of the
MySQL Connector Python 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.

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/Python, and its usage, see

  http://dev.mysql.com/doc/dev/connector-python

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

To download MySQL Connector/Python 8.0.20, see the “General Availability
(GA) Releases” tab at

  http://dev.mysql.com/downloads/connector/python/

Enjoy!

==============================================================================

Changes in MySQL Connector/Python 8.0.20 (2020-04-27, General Availability)

Functionality Added or Changed

 * For X DevAPI applications, when creating a new
   connection, if the connection data contains several
   target hosts that have no explicit priority assigned, the
   behavior of the failover logic now is the same as if all
   those target hosts have the same priority. That is, the
   next candidate for making a connection is chosen randomly
   from the remaining available hosts. Alternatively, the
   new priority attribute optionally sets the priority for
   each host. If two hosts have the same priority then one
   is chosen at random.

Bugs Fixed

 * The fetchmany() method failed to function properly when
   the last fetch was not a full batch; and would hang.
   Thanks to Bruce Feng for the patch.
   (Bug#30608703, Bug#97830)

On Behalf of Oracle/MySQL Engineering Team
Kent Boortz

MySQL Connector/ODBC 8.0.20 has been released

Dear MySQL users,

MySQL Connector/ODBC 8.0.20 is a new version in the MySQL Connector/ODBC
8.0 series, the ODBC driver for the MySQL Server.

The available downloads include both a Unicode driver and an ANSI driver
based on the same modern codebase. Please select the driver type you
need based on the type of your application – Unicode or ANSI.
Server-side prepared statements are enabled by default. It is suitable
for use with the latest MySQL server version 8.0.

This release of the MySQL ODBC driver is conforming to the ODBC 3.8
specification. It contains implementations of key 3.8 features,
including self-identification as a ODBC 3.8 driver, streaming of out for
binary types only), and support of the SQL_ATTR_RESET_CONNECTION
connection attribute (for the Unicode driver only).

The release is now available in source and binary form for a number of
platforms from our download pages at

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

For information on installing, please see the documentation at

https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-installation.html

Enjoy and thanks for the support!

================================================================

Changes in MySQL Connector/ODBC 8.0.20 (2020-04-27, General Availability)

  • Functionality Added or Changed
  • Bugs Fixed

Functionality Added or Changed

  • On Debian, DEB packages are now released instead of TGZ
    files. The file base names are mysql-connector-odbc-*
    (driver package) and mysql-connector-odbc-setup (setup
    package). The setup package contains the GUI
    configuration widget library (libmyodbc8S.so) and depends
    on the driver package. The driver package depends on the
    unixODBC libraries (libodbc, libodbcinst); and does not
    conflict with the official Debian package (libmyoodbc).

Bugs Fixed

  • When using SQL_C_WCHAR with SQLGetData, binary data was
    not returned correctly as its hexacecimal representation.
    Related, using SQL_C_CHAR with SQLGetData did return
    binary data as hex. (Bug #28864788, Bug #92429)
  • When binding an SQL_BIT type column to the SQL_C_CHAR
    type, SQLFetchScroll would return the values as an
    integer instead of a char. (Bug #28484784, Bug #91904)

On Behalf of Oracle/MySQL Engineering Team
Prashant Tekriwal

MySQL Connector/J 8.0.20 has been released

Dear MySQL users,

MySQL Connector/J 8.0.20 is the latest General Availability release of
the MySQL Connector/J 8.0 series.  It is suitable for use with MySQL
Server versions 8.0, 5.7, and 5.6.  It supports the Java Database
Connectivity (JDBC) 4.2 API, and implements the X DevAPI.

This release includes the following new features and changes, also
described in more detail on

https://dev.mysql.com/doc/relnotes/connector-j/8.0/en/news-8-0-20.html

As always, we recommend that you check the “CHANGES” file in the
download archive to be aware of changes in behavior that might affect
your application.

To download MySQL Connector/J 8.0.20 GA, see the “General Availability
(GA) Releases” tab at http://dev.mysql.com/downloads/connector/j/

Enjoy!

Changes in MySQL Connector/J 8.0.20 (2020-04-27, General Availability)

* Functionality Added or Changed

* Bugs Fixed

Functionality Added or Changed

* X DevAPI: Connector/J now supports data compression for X Protocol
connections (https://dev.mysql.com/doc/refman/8.0/en/x-plugin-connection- compression.html). See Connection Compression Using X DevAPI (https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-connection-compression-xdevapi.html) for details.

* A new method, getElapsedTime(), has been added to
Connector/J ‘s implementation of the Statement interface,
to expose the elapsed time for a query. Thanks to Matti
Sillanpää for contributing the code. (Bug #30570249, Bug
#97714)

Bugs Fixed

* When a custom Calendar was used in the setDate method for
a PreparedStatement, it was being used by subsequent
calls of the same method that did not use the same
calendar, resulting in the wrong date being set. It was
because the SimpleDateFormat object created internally
with the custom calendar was cached and reused. With this
fix, the object is no longer cached. (Bug #30877755)

* Setting the connection property clientInfoProvider
without using the fully qualified class name for
ClientInfoProviderSP caused a NullPointerException. This
was due to some wrong exception handling, which has been
corrected by this fix. (Bug #30832513)

* Authentication failed when a client tried to connect to a
server that used Windows Authentication Plugin and the
Kerberos protocol. It was because the implementation of
the NativeAuthenticationProvider class by Connector/J did
not interact correctly with a custom-made Kerberos
authentication plugin, and this patch fixes the issue.
(Bug #30805426)

* Methods from the ResultSetUtil class are no longer used
in Connector/J 8.0.20; the class has therefore been
removed. (Bug #30636056)

* A NullPointerException was returned when the connection
had cacheResultSetMetadata=true and a query containing
any SET statements was executed. This fix corrects the
issue by adding the missing variable assignment, and also
a null check. (Bug #30584907, Bug #97757)

* A DataConversionException was thrown when an application
tried to store a string starting with “d.” [d was any
digit] into a VARCHAR column. It was due to a parsing
error in the AbstractNumericValueFactory, which has been
fixed by this patch. Thanks to Nick Pollett for
contributing the code. (Bug #30570721, Bug #97724)

* When creating a Statement, the specification for the
resultSetType parameter was not honored, so that the
ResultSet type was always set to
ResultSet.TYPE_FORWARD_ONLY. With this fix, the
resultSetType parameter is now honored. Also, type
validation has been added so that calling the methods
beforeFirst, afterLast, first, last, absolute, relative,
or previous results in an exception if the ResultSet type
is ResultSet.TYPE_FORWARD_ONLY. (Bug #30474158)

* When a Calendar was not used, a java.sql.Date value could
not always be stored into and then retrieved from a MySQL
server consistently. It was because Connector/J always
converted a Date value to the server’s time zone when
storing it on the server as a MySQL DATE; but since a
MySQL DATE does not have any time value, the hour,
minute, and second parts of the original date was
effectively lost. If the converted value is one day ahead
of or behind the original value, when the value was
retrieved through Connector/J and converted back to the
local time zone, there was no time value for adjusting
the date back to its original value, resulting in a
one-day error. With this fix, any Date value is converted
to MySQL DATE value using the JVM’s time zone, so that
the value is always consistent when being stored and then
read back.
Also, the cacheDefaultTimezone connection property,
previously removed from Connector/J 8.0, has now been
restored so that when it is set to false, Connector/J
becomes aware of the time zone changes of the JVM during
runtime and converts dates with the updated time zone.
(Bug #28125069, Bug #91112)

On Behalf of MySQL Release Engineering Team,
Surabhi Bhat

Rethinking Result Sets in Connector/Node.js

It used to be the case where, in order to actually process data retrieved from the database using Connector/Node.js, you would have to resort to an API that required the use of both JavaScript callbacks and Promises. This was meant to provide more flexibility and control to the application developer and at the same time decrease the chance of buffering data unnecessarily. However this wasn’t useful for 99% of the use-cases and made simple tasks a little bit cumbersome. Also, the fact that it required using two different asynchronous constructs made it a little bit harder to grasp.

To make matters worse, in order to consume operational metadata about the columns in the result set, you would have to provide an additional callback, making the whole thing spiral a bit out of control, particularly when there were multiple result sets involved. In that case, you needed to create a shared context between the two functions in order to map data and metadata for each column in each result set.

Continue reading

MySQL Connector/C++ 8.0.19 has been released

Dear MySQL users,

MySQL Connector/C++ 8.0.19 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.19, see the “General Availability (GA)
Releases” tab at

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


==================================================

Changes in MySQL Connector/C++ 8.0.19 (2020-01-13, General Availability)

* Error Handling

* Legacy (JDBC API) Notes

* Packaging Notes

* X DevAPI Notes

* Functionality Added or Changed

* Bugs Fixed

Error Handling

* If an application tries to obtain a result set from a statement that does not produce one, an exception occurs. For applications that do not catch such exceptions, Connector/C++ now produces a more informative error message to indicate why the exception occurred. (Bug #28591814, Bug #92263)

Legacy (JDBC API) Notes

* For applications that use the legacy JDBC API (that is, not made using X DevAPI or X DevAPI for C), it is now possible when creating a new session to specify multiple hosts to be tried until a successful connection is established. A list of hosts can be given in the session creation options. The new OPT_MULTI_HOST option is disabled by default for backward compatibility, but if enabled in the ConnectionOptionsMap parameter passed to connect() calls, it permits other map parameters to specify multiple hosts. Examples:

sql::ConnectOptionsMap opts;
opts[“hostName”]=”host1,host2:13001,localhost:13000″;
opts[“schema”]=”test”; opts[“OPT_MULTI_HOST”] = true;
opts[“userName”]=”user”; opts[“password”]=”password”;
driver->connect(opts);

sql::ConnectOptionsMap opts; opts[“hostName”]=”tcp://host1,host2:13001,localhost:13000/test”; opts[“OPT_MULTI_HOST”] = true;
opts[“userName”]=”user”; opts[“password”]=”password”;
driver->connect(opts);

sql::ConnectOptionsMap opts; opts[“hostName”]=”mysql://host1,host2:13001,localhost:13000/test”; opts[“OPT_MULTI_HOST”] = true;
opts[“userName”]=”user”;
opts[“password”]=”password”;
driver->connect(opts);

Port values are host specific. If a host is specified without a port number, the default port is used. These rules apply:

+ If OPT_MULTI_HOST is disabled and multiple hosts are specified, an error occurs.

+ If OPT_MULTI_HOST is disabled and a single host that resolves to multiple hosts is specified, the first host is used for backward compatibility.

+ If OPT_MULTI_HOST is enabled and multiple hosts are specified, one of them is randomly chosen as the connection target. If the target fails, another host is randomly chosen from those that remain. If all targets fail, an error occurs.

+ The hostName parameter can accept a URI that contains a list of comma-separated hosts. The URI scheme can be mysql://, which works like tcp://. The URI scheme can also be omitted, so the parameter can be a list of comma-separated hosts.

+ The connect() syntax that takes URI, user, and password parameters does not permit multiple hosts because in that case OPT_MULTI_HOST is disabled.

Packaging Notes

* Connector/C++ now is compatible with MSVC 2019, while retaining compatibility with MSVC 2017:

+ Previously, Connector/C++ binary distributions were compatible with projects built using MSVC 2017 or 2015. Binary distributions now are compatible with projects built using MSVC 2019 (using either dynamic or static connector libraries) or MSVC 2017 (using dynamic connector libraries). Building using MSVC 2015 might work, but is not supported.

+ Previously, Connector/C++ source distributions could be built using MSVC 2017 or 2015. Source distributions now can be built using MSVC 2019 or 2017. Building using MSVC 2015 might work, but is not supported.

+ Previously, the MSI installer accepted the Visual C++ Redistributable for Visual Studio 2017 or 2015. The MSI installer now accepts the Visual C++ Redistributable for Visual Studio 2019 or 2017.

X DevAPI Notes

* For applications that use X DevAPI or X DevAPI for C, Connector/C++ now provides options that enable specifying the permitted TLS protocols and ciphersuites for TLS connection negotiation:

+ TLS protocols must be chosen from this list: TLSv1, TLSv1.1, TLSv1.2, TLSv1.3. (TLSv1.3 requires that both the server and Connector/C++ be compiled with OpenSSL 1.1.1 or higher.)

+ Ciphersuite values must be IANA ciphersuite names. TLS protocols and ciphersuites now may be specified in these contexts:

+ Connection strings permit tls-versions and tls-ciphersuites options. The tls-versions value is a list of one or more comma-separated TLS protocol versions. The tls-ciphersuites value is a list of one or more comma-separated ciphersuite names. Examples:
…?tls-versions=[TLSv1.3]&…
…?tls-versions=[TLSv1.2,TLSv1.3]&…
…?tls-ciphersuites=[
TLS_DHE_PSK_WITH_AES_128_GCM_SHA256, TLS_CHACHA20_POLY1305_SHA256
]&…

+ SessionSettings objects permit TLS_VERSIONS and TLS_CIPHERSUITES options. Each value is either a string containing one or more comma-separated items or a container with strings (that is, any type that can be iterated with a loop that yields string values).
Example of single string values:
Session s(…,
TLS_VERSIONS, “TLSv1.2,TLSv1.3”,
TLS_CIPHERSUITES, “TLS_DHE_PSK_WITH_AES_128_GCM_SHA256,TLS_CHACHA20_POLY1305_SHA256” ,
…);
Example of string container values:
std::list<std::string> tls_versions = {
“TLSv1.2”,
“TLSv1.3”
};

std::list<std::string> ciphers = {
“TLS_DHE_PSK_WITH_AES_128_GCM_SHA256”, “TLS_CHACHA20_POLY1305_SHA256”
};

Session s(…,
TLS_VERSIONS, tls_versions
TLS_CIPHERSUITES, ciphers,
…);

Session s(…,
TLS_VERSIONS, std::vector{“TLSv1.2″,”TLSv1.3”},
TLS_CIPHERSUITES, std::vector{“TLS_DHE_PSK_WITH_AES_128_GCM_SHA256”, “TLS_CHACHA20_POLY1305_SHA256”},
…);

+ mysqlx_session_option_set() and friends permit MYSQLX_OPT_TLS_VERSIONS and MYSQLX_OPT_TLS_CIPHERSUITES session option constants, together with the corresponding OPT_TLS_VERSIONS() and OPT_TLS_CIPHERSUITES() macros. MYSQLX_OPT_TLS_VERSIONS and MYSQLX_OPT_TLS_CIPHERSUITES accept a string containing one or more comma-separated items. Examples:
mysqlx_session_option_set(opts, …,
OPT_TLS_VERSIONS(“TLSv1.2,TLSv1.3”),
OPT_TLS_CIPHERSUITES( “TLS_DHE_PSK_WITH_AES_128_GCM_SHA256,TLS_CHACHA20_POLY1305_SHA256”
),
…)

For more information about TLS protocols and ciphersuites in MySQL, see Encrypted Connection TLS Protocols and Ciphers (https://dev.mysql.com/doc/refman/8.0/en/encrypted-connection-protocols-ciphers.html). (Bug #28964583, Bug #93299)

* For X DevAPI or X DevAPI for C, when creating a new connection (given by a connection string or other means), if the connection data contains several target hosts that have no explicit priority assigned, the behavior of the failover logic now is the same as if all those target hosts have the same priority. That is, the next candidate for making a connection is chosen randomly from the remaining available hosts. This is a change from previous behavior, where hosts with no explicit priority were assigned implicit decreasing priorities and tried in the same order as listed in the connection data.

Functionality Added or Changed

* Connector/C++ now supports the use of DNS SRV records to specify multiple hosts:

+ Session and session-pool creation accepts a URI scheme of mysqlx+srv:// that enables the DNS SRV feature in connect strings. Example: mysqlx+srv://example.com/db?options

+ For X DevAPI, mysqlx::Session objects permit a SessionOption::DNS_SRV entry to enable use of a DNS SRV record to specify available services. Example:
mysqlx::Session sess(
SessionOption::HOST, “example.com”,
SessionOption::DNS_SRV, true,
SessionOption::USER, “user”,
SessionOption::PWD, “password”);

Similarly, for X DevAPI for C, the mysqlx_session_option_set() function permits an OPT_DNS_SRV() option in the argument list. Example: mysqlx_session_option_set(opt,
OPT_HOST(“example.com”),
OPT_DNS_SRV(true)
OPT_USER(“user”),
OPT_PWD(“password”),
PARAM_END));

+ For applications that use the legacy JDBC API (that is, not made using X DevAPI or X DevAPI for C), connection maps permit an OPT_DNS_SRV element. A map should specify the host for SRV lookup as a full lookup name and without a port. Example:
sql::ConnectOptionsMap opts;
opts[“hostName”] = “_mysql._tcp.host1.example.com”;
opts[“OPT_DNS_SRV”] = true;
opts[“userName”] = “user”;
opts[“password”] = “password”;
driver->connect(opts);

In legacy applications, DNS SRV resolution cannot be enabled in URI connect strings because parameters are not supported in such strings.

Bugs Fixed

* Connector/C++ failed to compile using Clang on Linux. (Bug #30450484)

* 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 Release Engineering Team,
Surabhi Bhat

MySQL Connector/Python 8.0.19 has been released

Dear MySQL users,

MySQL Connector/Python 8.0.19 is the latest GA release version of the
MySQL Connector Python 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.

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/Python, and its usage, see

http://dev.mysql.com/doc/dev/connector-python

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

To download MySQL Connector/Python 8.0.19, see the “General Availability
(GA) Releases” tab at

http://dev.mysql.com/downloads/connector/python/

Enjoy!

==============================================================================

Changes in MySQL Connector/Python 8.0.19 (2020-01-13, General Availability)


     * Functionality Added or Changed

     * Bugs Fixed

Functionality Added or Changed


     * Added DNS SRV support.
       To automatically resolve any SRV record available in a
       target DNS server or service discovery endpoint, use the
       mysqlx+srv scheme+extension in a X DevAPI connection
       string, or mysqlx+srv for the classic protocol, or by
       enabling the dns-srv=True (or dns_srv=True) connection
       option when using keyword arguments or dictionaries.

     * Added two new connection options that evaluate during the
       TLS handshake to restrict the negotiated TLS protocols
       and ciphers; along with those configured on the server
       that can further restrict the final choices. The new
       options are tls-versions to define the allowed TLS
       protocol versions, and tls-ciphersuites for the allowed
       cipher suitess. These definitions are comma-separated,
       and accepted by the getSession() and getClient() methods.
       tls-versions: accepts one or more of the following:
       TLSv1, TLSv1.1, TLSv1.2, and TLSv1.3. Other values
       generate an error. Example usage:
mysqlx://myserver/db?tls-versions=[TLSv1.2,TLSv1.3]
       tls-ciphersuites: accepts IANA cipher suite names, as
       listed on IANA’s TLS Cipher Suites
(https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4)
       page. Unsupported or
       unknown values are ignored. Example usage:
mysqlx://myserver/db?tls-ciphersuites=[TLS_DHE_PSK_WITH_A
       ES_128_GCM_SHA256, TLS_CHACHA20_POLY1305_SHA256]

     * The internal X Protocol namespace changed from xplugin to
       mysqlx.
       MySQL Server removed xplugin namespace support in
       v8.0.19; for Connector/Python this means:

          + With Connector/Python v8.0.19 and higher, some X
            DevAPI Protocol operations do not function with
            MySQL Server v8.0.18 and lower, operations such as
            Schema.create_collection(), Schema.get_collections(),
            Schema.get_tables(), and Collection.create_index().

          + Connector/Python 8.0.19 can connect to MySQL Server
            8.0.18 and lower, as both the ‘xplugin’ (with deprecation
            warnings) and ‘mysqlx’ namespaces can be used.

Bugs Fixed


     * Fixed the reserved SSL authentication filed; it changed
       from 23 to 22. Thanks to Qianqian Bu for the patch. (Bug
       #30270760, Bug #96770)
       References: This issue is a regression of: Bug #29855733.

     * Fixed LOAD DATA INFILE LOCAL handling; the file handle
       was not closed. Thanks to Micah Gale for the patch. (Bug
       #29417117, Bug #94496)


On Behalf of Oracle/MySQL Engineering Team
Prashant Tekriwal