The following code gets stuck at conn.rollback(). If I change the undefined parameter to null(name is not nullable), it rolls back as expected. I know the parameters should not be undefined, but there is always a chance of accidents.
await conn.beginTransaction();
try {
const stmt = await conn.prepare("INSERT INTO foo(name)VALUES(?)");
try {
await stmt.execute([undefined]);
} finally {
await stmt.close();
}
console.log('commiting...');
await conn.commit();
console.log('committed.');
} catch (e) {
console.error(e);
console.log('rolling back...');
await conn.rollback();
console.log('rolled back.');
} finally {
conn.release();
}