不要怂,就是干,撸起袖子干!

Commit 4392201b by Jozef Hartinger Committed by Sushant

#7184 Regression in affected rows reporting for updates (#7423)

Introduces dialectOptions.foundRows configuration option that can be set to bring back
update behavior from before this commit https://github.com/sequelize/sequelize/commit/4f95f176eba4a7ad7c71108dd48955884d16eb6b

https://github.com/sequelize/sequelize/issues/7184
1 parent 13a3f1e4
...@@ -102,5 +102,20 @@ if (dialect === 'mysql') { ...@@ -102,5 +102,20 @@ if (dialect === 'mysql') {
return cm.releaseConnection(connection); return cm.releaseConnection(connection);
}); });
}); });
it('-FOUND_ROWS can be suppressed to get back legacy behavior', () => {
const sequelize = Support.createSequelizeInstance({ dialectOptions: { flags: '' }});
const User = sequelize.define('User', { username: DataTypes.STRING });
return User.sync({force: true})
.then(() => User.create({ id: 1, username: 'jozef' }))
.then(() => User.update({ username: 'jozef'}, {
where: {
id: 1
}
}))
// https://github.com/sequelize/sequelize/issues/7184
.spread(affectedCount => affectedCount.should.equal(1));
});
}); });
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!