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

Commit 132d48fd by Sushant Committed by Jan Aagaard Meier

set no autocommit for MySQL by default (#6001)

1 parent cd2e38e4
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
- [FIXED] All associations now prefer aliases to construct foreign key [#5267](https://github.com/sequelize/sequelize/issues/5267) - [FIXED] All associations now prefer aliases to construct foreign key [#5267](https://github.com/sequelize/sequelize/issues/5267)
- [REMOVED] Default transaction auto commit [#5094](https://github.com/sequelize/sequelize/issues/5094) - [REMOVED] Default transaction auto commit [#5094](https://github.com/sequelize/sequelize/issues/5094)
- [REMOVED] Callback support for hooks [#5228](https://github.com/sequelize/sequelize/issues/5228) - [REMOVED] Callback support for hooks [#5228](https://github.com/sequelize/sequelize/issues/5228)
- [FIXED] Broken transactions in `MySQL` [#3568](https://github.com/sequelize/sequelize/issues/3568)
## BC breaks: ## BC breaks:
- `hookValidate` removed in favor of `validate` with `hooks: true | false`. `validate` returns a promise which is rejected if validation fails - `hookValidate` removed in favor of `validate` with `hooks: true | false`. `validate` returns a promise which is rejected if validation fails
......
...@@ -1692,6 +1692,11 @@ var QueryGenerator = { ...@@ -1692,6 +1692,11 @@ var QueryGenerator = {
return; return;
} }
// no query when value is not explicitly set
if (typeof value === 'undefined' || value === null) {
return;
}
return 'SET autocommit = ' + (!!value ? 1 : 0) + ';'; return 'SET autocommit = ' + (!!value ? 1 : 0) + ';';
}, },
......
...@@ -35,10 +35,7 @@ MysqlDialect.prototype.supports = _.merge(_.cloneDeep(Abstract.prototype.support ...@@ -35,10 +35,7 @@ MysqlDialect.prototype.supports = _.merge(_.cloneDeep(Abstract.prototype.support
updateOnDuplicate: true, updateOnDuplicate: true,
indexViaAlter: true, indexViaAlter: true,
NUMERIC: true, NUMERIC: true,
GEOMETRY: true, GEOMETRY: true
transactionOptions: {
autocommit: true
}
}); });
ConnectionManager.prototype.defaultVersion = '5.6.0'; ConnectionManager.prototype.defaultVersion = '5.6.0';
......
...@@ -34,10 +34,6 @@ describe('Transaction', function() { ...@@ -34,10 +34,6 @@ describe('Transaction', function() {
all: [ all: [
'START TRANSACTION;' 'START TRANSACTION;'
], ],
mysql: [
'START TRANSACTION;',
'SET autocommit = 1;'
],
sqlite: [ sqlite: [
'BEGIN DEFERRED TRANSACTION;' 'BEGIN DEFERRED TRANSACTION;'
], ],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!