Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 132d48fd
authored
Jun 01, 2016
by
Sushant
Committed by
Jan Aagaard Meier
Jun 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set no autocommit for MySQL by default (#6001)
1 parent
cd2e38e4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
8 deletions
changelog.md
lib/dialects/abstract/query-generator.js
lib/dialects/mysql/index.js
test/unit/transaction.test.js
changelog.md
View file @
132d48f
...
@@ -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
...
...
lib/dialects/abstract/query-generator.js
View file @
132d48f
...
@@ -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
)
+
';'
;
},
},
...
...
lib/dialects/mysql/index.js
View file @
132d48f
...
@@ -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'
;
...
...
test/unit/transaction.test.js
View file @
132d48f
...
@@ -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;'
],
],
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment