mariadb-corporation / mariadb-connector-nodejs

MariaDB Connector/Node.js is used to connect applications developed on Node.js to MariaDB and MySQL databases. MariaDB Connector/Node.js is LGPL licensed.
GNU Lesser General Public License v2.1
366 stars 91 forks source link

pool.batch() - Cannot read properties of undefined after upgrade to 3.1.0 #235

Closed mikerowe81 closed 1 year ago

mikerowe81 commented 1 year ago

Just upgraded to 3.1.0 and I'm getting the following error when running pool.batch()

...\node_modules\mariadb\lib\cmd\batch-bulk.js:388
        if (this._rows[0].affectedRows !== undefined) {
                          ^

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)

Here is my PoolConfig:

        host: process.env.DB_HOST,
        user: process.env.DB_USER,
        port: Number(process.env.DB_PORT) || 3306,
        password: process.env.DB_PASSWORD,
        database: process.env.DB_DATABASE,
        connectionLimit: 4,
        idleTimeout: 10,
        namedPlaceholders: true,
        rowsAsArray: false,
        insertIdAsNumber: true,
        dateStrings: true,
        decimalAsNumber: true,
        bigIntAsNumber: true,
        metaAsArray: true,
        trace: process.env.NODE_ENV === 'development',
        typeCast: typeCast

Will revert back to 3.0.2 for now. Thanks

rusher commented 1 year ago

problem identified. This concerns metaAsArrayoption only, and will be corrected in 3.1.1