Release Notes for MariaDB Connector/Node.js 3.1.1
This page is part of MariaDB's MariaDB Documentation.
The parent of this page is: Release Notes for MariaDB Connector/Node.js 3.1
Topics on this page:
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.1 was released on 2023-03-17. This release is of General Availability (GA) maturity.
Due to changes in the default behavior of Node.js 15, when a
poolobject has an unhandled
errorevent, the application can abort with an exception. (CONJS-246)
In previous releases, when a
poolobject has an unhandled
errorevent, the application can abort with an error message similar to the following:
UnhandledPromiseRejectionWarning: Error: retrieve connection from pool timeout after 10001ms at Object.module.exports.createError (/PROJECT_PATH/node_modules/mariadb/lib/misc/errors.js:61:10) at timeoutTask (/PROJECT_PATH/node_modules/mariadb/lib/pool-base.js:319:16) at Timeout.rejectAndResetTimeout [as _onTimeout] (/PROJECT_PATH/node_modules/mariadb/lib/pool-base.js:342:5) at listOnTimeout (internal/timers.js:556:17) at processTimers (internal/timers.js:497:7)
Starting with this release,
poolobjects define default listeners for
errorevents, so that all
errorevents are handled by default.
resetAfterUseenabled, connections are reset after being used, but the prepared statement cache is not also reset, which can cause errors to occur when cached prepared statements are used. (CONJS-240)
In previous releases, an error with the
ER_UNKNOWN_STMT_HANDLERerror code could occur in this scenario:
Unknown prepared statement handler (PS_ID) given to mysqld_stmt_execute
Starting with this release, the prepared statement cache is reset when the connection is reset.
Node.js 12 compatibility is broken. (CONJS-244)
In Connector/Node.js 3.1.0, features and syntax incompatible with Node.js 12 are used, including private methods that use the
Starting with this release, Connector/Node.js uses features and syntax compatible with Node.js 12.
metaAsArrayare enabled, executing
batch()on a connection or pool fails with an error. (CONJS-245)
In previous releases, the following error could occur:
TypeError: Cannot read properties of undefined (reading 'affectedRows') at BatchBulk.success (...\node_modules\mariadb\lib\cmd\batch-bulk.js:388:27) at BatchBulk.readOKPacket (...\node_modules\mariadb\lib\cmd\parser.js:182:19) at BatchBulk.readResponsePacket (...\node_modules\mariadb\lib\cmd\parser.js:49:21) at PacketInputStream.receivePacketBasic (...\node_modules\mariadb\lib\io\packet-input-stream.js:80:9) at PacketInputStream.onData (...\node_modules\mariadb\lib\io\packet-input-stream.js:130:20)
Starting with this release, executing
batch()should not raise an error when