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 f1289159
authored
Dec 07, 2015
by
Mick Hansen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4919 from lukealbao/master
[MSSQL] Fix connection manager domain usage
2 parents
1c0d3e10
25c76623
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
1 deletions
lib/dialects/mssql/connection-manager.js
test/unit/dialects/mssql/connection-manager.js
lib/dialects/mssql/connection-manager.js
View file @
f128915
...
@@ -53,7 +53,6 @@ ConnectionManager.prototype.connect = function(config) {
...
@@ -53,7 +53,6 @@ ConnectionManager.prototype.connect = function(config) {
// The 'tedious' driver needs domain property to be in the main Connection config object
// The 'tedious' driver needs domain property to be in the main Connection config object
if
(
config
.
dialectOptions
.
domain
)
{
if
(
config
.
dialectOptions
.
domain
)
{
connectionConfig
.
domain
=
config
.
dialectOptions
.
domain
;
connectionConfig
.
domain
=
config
.
dialectOptions
.
domain
;
delete
config
.
dialectOptions
.
domain
;
}
}
Object
.
keys
(
config
.
dialectOptions
).
forEach
(
function
(
key
)
{
Object
.
keys
(
config
.
dialectOptions
).
forEach
(
function
(
key
)
{
...
...
test/unit/dialects/mssql/connection-manager.js
0 → 100644
View file @
f128915
'use strict'
;
var
chai
=
require
(
'chai'
)
,
expect
=
chai
.
expect
,
Sequelize
=
require
(
__dirname
+
'/../../../../index'
);
var
tedious
=
require
(
'tedious'
)
,
sinon
=
require
(
'sinon'
)
,
connectionStub
=
sinon
.
stub
(
tedious
,
'Connection'
);
connectionStub
.
returns
({
on
:
function
()
{}});
describe
(
'[MSSQL] Connection Manager'
,
function
()
{
var
instance
,
config
;
beforeEach
(
function
()
{
config
=
{
dialect
:
'mssql'
,
database
:
'none'
,
username
:
'none'
,
password
:
'none'
,
host
:
'localhost'
,
port
:
2433
,
pool
:
{},
dialectOptions
:
{
domain
:
'TEST.COM'
}
};
instance
=
new
Sequelize
(
config
.
database
,
config
.
username
,
config
.
password
,
config
);
});
it
(
'connectionManager.$connect() Does not delete `domain` from config.dialectOptions'
,
function
()
{
expect
(
config
.
dialectOptions
.
domain
).
to
.
equal
(
'TEST.COM'
);
instance
.
dialect
.
connectionManager
.
$connect
(
config
);
expect
(
config
.
dialectOptions
.
domain
).
to
.
equal
(
'TEST.COM'
);
});
});
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