Documentation Home
MySQL Connector/Node.js Release Notes
Download these Release Notes
PDF (US Ltr) - 92.8Kb
PDF (A4) - 93.6Kb
HTML Download (TGZ) - 27.8Kb
HTML Download (Zip) - 55.3Kb


MySQL Connector/Node.js Release Notes  /  Changes in MySQL Connector/Node.js 8.0  /  Changes in MySQL Connector/Node.js 8.0.16 (2019-04-25, General Availability)

Changes in MySQL Connector/Node.js 8.0.16 (2019-04-25, General Availability)

X DevAPI Notes

  • Connector/Node.js now supports connection attributes as key-value pairs that application programs can pass to the server. Connector/Node.js defines a default set of attributes, which can be disabled or enabled. In addition to these default attributes, applications can also provide their own set of custom attributes.

    • Specify connection attributes as a connection-attributes parameter in a connection string, or by using the connectionAttributes property using either a plain JavaScript object or JSON notation to specify the connection configuration options.

      The connection-attributes parameter value must be either empty (the same as specifying true), a Boolean value (true or false to enable or disable the default attribute set), or a list of zero or more key=value pair specifiers separated by commas (to be sent in addition to the default attribute set). Within a list, a missing key value evaluates as NULL.

      The connectionAttributes property allows passing user-defined attributes to the application using either a plain JavaScript object or JSON notation to specify the connection configuration options. Define each attribute in a nested object under connectionAttributes where the property names matches the attribute names, and the property values match the attribute values. Unlike connection-attributes, and while using plain JavaScript objects or JSON notation, if the connectionAttributes object contains duplicate keys then no error is thrown and the last value specified for a duplicate object key is chosen as the effective attribute value.

      Examples:

      Not sending the default client-defined attributes:

      mysqlx.getSession('{ "user": "root", "connectionAttributes": false }')
      
      mysqlx.getSession('mysqlx://root@localhost?connection-attributes=false')
      
      mysqlx.getSession({ user: 'root', connectionAttributes: { foo: 'bar', baz: 'qux', quux: '' } })
      mysqlx.getSession('mysqlx://root@localhost?connection-attributes=[foo=bar,baz=qux,quux]')

    Application-defined attribute names cannot begin with _ because such names are reserved for internal attributes.

    If connection attributes are not specified in a valid way, an error occurs and the connection attempt fails.

    For general information about connection attributes, see Performance Schema Connection Attribute Tables.

Functionality Added or Changed

  • Optimized the reuse of existing connections through client.getSession() by only re-authenticating if required.

  • For X DevAPI, performance for statements that are executed repeatedly (two or more times) is improved by using server-side prepared statements for the second and subsequent executions. This happens internally; applications need take no action and API behavior should be the same as previously. For statements that change, repreparation occurs as needed. Providing different data values or different offset() or limit() values does not count as a change. Instead, the new values are passed to a new invocation of the previously prepared statement.

Bugs Fixed

  • Idle pooled connections to MySQL Server were not reused, and instead new connections had to be recreated. (Bug #29436892)

  • Executing client.close() would not close all associated connections in the connection pool. (Bug #29428477)

  • connectTimeout instead of maxIdleTime determined whether idle connections in the connection pool were reused rather than creating new connections. (Bug #29427271)

  • Released connections from the connection pool were not being reset and reused; instead new connections were being made. (Bug #29392088)

  • Date values in documents were converted to empty objects when inserted into a collection. (Bug #29179767, Bug #93839)

  • A queueTimeout value other than 0 (infinite) prevented the acquisition of old released connections from the connection pool. (Bug #29179372, Bug #93841)