You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all thanks for all the hard work on this package!
When running an query that returns two columns with the same name, the software throws an error 'duplicate field name'. When I catch this error and try to rollback the transaction, the software throws another (uncaught) error, which crashes the program. Tested with version 2.4.0
Test case:
create table test1
(
my_col int
);
create table test2
(
my_col int
)
import mariadb from 'mariadb'
async function test () {
loadEnvFiles('backend')
let connection = await mariadb.createConnection(myConfiguration)
await connection.beginTransaction()
try {
let results = await connection.query('SELECT * FROM test1 INNER JOIN test2 on test1.my_col=test2.my_col')
console.log('Got results', results)
} catch (error) {
try {
await connection.rollback()
} catch (rollbackError) {
console.log('Got rollbackError', rollbackError)
}
console.log('Got error', error)
}
}
test()
This results in the output:
/home/koen/zelfstandige/give-a-day/site/backend/node_modules/mariadb/lib/cmd/common-text-cmd.js:256
row[this.tableHeader[i]] = this._getValue(i, columns[i], this.opts, connOpts, packet);
^
TypeError: Cannot read property '0' of null
at Query.parseRowStd (/home/koen/zelfstandige/give-a-day/site/backend/node_modules/mariadb/lib/cmd/common-text-cmd.js:256:59)
at Query.readResultSetRow (/home/koen/zelfstandige/give-a-day/site/backend/node_modules/mariadb/lib/cmd/resultset.js:435:22)
at PacketInputStream.receivePacketBasic (/home/koen/zelfstandige/give-a-day/site/backend/node_modules/mariadb/lib/io/packet-input-stream.js:104:9)
at PacketInputStream.onData (/home/koen/zelfstandige/give-a-day/site/backend/node_modules/mariadb/lib/io/packet-input-stream.js:169:20)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:302:12)
at readableAddChunk (_stream_readable.js:278:9)
at Socket.Readable.push (_stream_readable.js:217:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
I expect that the error is printed in the log statement console.log('Got error', error)
Thanks!
The text was updated successfully, but these errors were encountered:
Hi,
First of all thanks for all the hard work on this package!
When running an query that returns two columns with the same name, the software throws an error 'duplicate field name'. When I catch this error and try to rollback the transaction, the software throws another (uncaught) error, which crashes the program. Tested with version 2.4.0
Test case:
This results in the output:
I expect that the error is printed in the log statement
console.log('Got error', error)Thanks!
The text was updated successfully, but these errors were encountered: