Release Notes for MariaDB Connector/Node.js 3.1.1

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.1 was released on 2023-03-17. This release is of General Availability (GA) maturity.

Issues Fixed

  • Due to changes in the default behavior of Node.js 15, when a pool object has an unhandled error event, the application can abort with an exception. (CONJS-246)

    • In previous releases, when a pool object has an unhandled error event, 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, pool objects define default listeners for error events, so that all error events are handled by default.

  • When a pool object has resetAfterUse enabled, 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)

  • 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 # prefix.

    • Starting with this release, Connector/Node.js uses features and syntax compatible with Node.js 12.

  • When bulk and metaAsArray are 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 bulk and metaAsArray are enabled.

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.