Release Notes for MariaDB Connector/Node.js 3.1.0
This page is part of MariaDB's Documentation.
The parent of this page is: Release Notes for MariaDB Connector/Node.js 3.1
Topics on this page:
Overview
MariaDB Connector/Node.js is the interface between Node.js applications and MariaDB Server. MariaDB Connector/Node.js enables development of Node.js applications.
MariaDB Connector/Node.js 3.1.0 was released on 2023-02-15. This release is of General Availability (GA) maturity.
Notable Changes
Time Zone Conversions
Instead of performing time zone conversions locally, MariaDB Connector/Node.js can set the session value of the
time_zonesystem variable, which allows the remote server to handle time zone conversions. (CONJS-237)In previous releases, time zone conversions are performed locally, which could cause issues when calling certain date and time functions.
Starting with this release, all time zone conversions are performed on the remote server. The
timezoneparameter is used to configure the behavior. The arguments have not changed, but the meaning of each argument has changed slightly:timezone(Parameter Argument)Description
localThis is the default mode.
The session value of the
time_zonesystem variable is not set, so no time zone conversion is performed.This mode is only recommended when the client and server use the same time zone.
autoIf the server's time zone is different from the client's time zone, the session value of the
time_zonesystem variable is set to the client's time zone.This mode is recommended when the server and client use different time zones, but the client's time zone is known to be properly configured.
If the client's time zone is set to an IANA time zone name and the remote server is MariaDB Server, the time zone database must be loaded on the remote server. MariaDB Server only supports IANA time zone names in the
time_zonesystem variable when the data from the IANA time zone database (also known astzdataorzoneinfo) has been loaded using themariadb-tzinfo-to-sqlutility.
IANA time zone name(such asAmerica/New_York)The session value of the
time_zonesystem variable is set to the provided IANA time zone name without checking the server's time zone.If the remote server is MariaDB Server, the time zone database must be loaded on the remote server. MariaDB Server only supports IANA time zone names in the
time_zonesystem variable when the data from the IANA time zone database (also known astzdataorzoneinfo) has been loaded using themariadb-tzinfo-to-sqlutility.
UTC offset(such as-04:00)The session value of the
time_zonesystem variable is set to the provided UTC offset without checking the server's time zone.
Performance Improvements
Performance improvements have been implemented for the internal result-set metadata parser. (CONJS-230)
Performance improvements have been implemented for the internal prepared statement parser. (CONJS-229)
Performance improvements have been implemented for the execution of command packets that have a known size, such as
COM_PING,COM_STMT_CLOSE,COM_QUIT, andCOM_RESET_CONNECTION. (CONJS-238)
Result-set Metadata
The
metaproperty of result-set objects can be non-enumerable. (CONJS-225)In previous releases, the
metaproperty of result-set objects is always enumerable.Starting with this release, the
metaproperty of result-set objects is non-enumerable by default. To obtain the old behavior, set themetaEnumerableconnection parameter totrue.
TypeScript Improvements
With TypeScript, the
batch(),execute(), andquery()methods have been internally defined to have type assertions, so that applications can assign the return values without defining type assertion at the application level. (CONJS-235)In previous releases, assigning the return values of the
batch(),execute(), andquery()methods required type assertions, which means theMETHOD_CALL() AS TYPE_NAMEor<TYPE_NAME> METHOD_CALL()syntax was required.Starting with this release, the type assertions are defined internally using generic types.
Prepared Statement Cache
The prepared statement cache is more resilient at handling cases where a prepared statement has already been closed. (CONJS-240)
The prepared statement cache is used when the
prepareCacheLengthconnection parameter is greater than0.In previous releases, MariaDB Connector/Node.js could attempt to use a cached prepared statement, even if it had already been closed, which could cause the
ER_UNKNOWN_STMT_HANDLERerror code to be raised:Unknown prepared statement handler (PREPARED_STATEMENT_ID) given to mysqld_stmt_executeStarting with this release, MariaDB Connector/Node.js tracks when a prepared statement has been closed and raises the following error when a closed prepared statement is used:
Execute fails, prepare command as already been closed
Issues Fixed
When executing a batch with a parameter that is longer than
max_allowed_packet, MariaDB Connector/Node.js can lose 4 bytes of the parameter's value. (CONJS-231)When the is used in the binary protocol with a value that does not contain microseconds, MariaDB Connector/Node.js incorrectly decodes the value. (CONJS-236)
When using the Callback API, connection initialization queries are not always executed before user queries. (CONJS-239)
Connection initialization queries include the queries executed due to the
forceVersionCheck,initSql,queryTimeout, andtimezoneconnection parameters.
When a connection is killed while a query is still running, the local connection object is destroyed, but the query can sometimes continue running on the remote server. (CONJS-232)
With TypeScript, the
metaAsArrayandrowsAsArrayproperties are missing in the definition of theConnectionConfigandQueryConfiginterfaces. (CONJS-241)
Installation
Upgrade
MariaDB Connector/Node.js 3.1 is fully compatible with MariaDB Connector/Node.js 3.3. As a new fully compatible major version, MariaDB Connector/Node.js 3.3 supersedes MariaDB Connector/Node.js 3.1, and users should upgrade to 3.3.
