{"action":"created","comment":{"url":"https://api.github.com/repos/sequelize/sequelize/pulls/comments/45917823","id":45917823,"diff_hunk":"@@ -0,0 +1,50 @@\n+'use strict';\n+\n+var chai = require('chai')\n+  , expect = chai.expect\n+  , Sequelize = require(__dirname + '/../../../../index')\n+  , config = require(__dirname + '/../../../config/config').mssql;\n+\n+config.dialect = 'mssql';\n+config.dialectOptions = {};\n+config.dialectOptions.domain = 'TEST.COM';\n+\n+describe('[MSSQL] Connection Manager', function () {\n+  var instance;\n+  beforeEach(function () {\n+    instance = new Sequelize(config.database\n+                             , config.username\n+                             , config.password\n+                             , config);\n+  });\n+  \n+  it('Does not delete `domain` from config.dialectOptions', function (done) {\n+    // Commit 91fc76be10 deleted config.dialectOptions.domain after creating a\n+    // connection. As a result, every subsequent connection was unable to\n+    // authenticate to a domain, since it was passed to `connectionConfig`\n+    // as undefined.\n+    //\n+    // This test will fail authentication to the server, since there is no domain,\n+    // but it does confirm that config.dialectOptions.domain persists for\n+    // subsequent connections.\n+\n+    expect(config.dialectOptions.domain).to.equal('TEST.COM');\n+    \n+    instance.dialect.connectionManager.$connect(config).then(function (res) {\n+      expect(config.dialectOptions.domain).to.equal('TEST.COM');\n+      done();\n+    })\n+    .catch(function (err) {\n+      // We expect a SequelizeConnectionError\n+      if (err.name !== 'SequelizeConnectionError') {\n+        throw err;\n+      }\n+      expect(config.dialectOptions.domain).to.equal('TEST.COM');\n+      done();\n+    })\n+    .catch(function (err) {\n+      // err MAY be a Chai AssertionError. Pass it to done.\n+      done(err);\n+    });\n+  });\n+});","path":"test/integration/dialects/mssql/connection-manager.js","position":50,"original_position":50,"commit_id":"c26aba59e873cd6e437729f3967144b1e6db0b62","original_commit_id":"c26aba59e873cd6e437729f3967144b1e6db0b62","user":{"login":"lukealbao","id":3156841,"avatar_url":"https://avatars.githubusercontent.com/u/3156841?v=3","gravatar_id":"","url":"https://api.github.com/users/lukealbao","html_url":"https://github.com/lukealbao","followers_url":"https://api.github.com/users/lukealbao/followers","following_url":"https://api.github.com/users/lukealbao/following{/other_user}","gists_url":"https://api.github.com/users/lukealbao/gists{/gist_id}","starred_url":"https://api.github.com/users/lukealbao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukealbao/subscriptions","organizations_url":"https://api.github.com/users/lukealbao/orgs","repos_url":"https://api.github.com/users/lukealbao/repos","events_url":"https://api.github.com/users/lukealbao/events{/privacy}","received_events_url":"https://api.github.com/users/lukealbao/received_events","type":"User","site_admin":false},"body":"Excellent. Thanks, @mickhansen. Where should I put this test, and should I submit it as a separate PR instead?","created_at":"2015-11-25T20:53:29Z","updated_at":"2015-11-25T20:53:29Z","html_url":"https://github.com/sequelize/sequelize/pull/4919#discussion_r45917823","pull_request_url":"https://api.github.com/repos/sequelize/sequelize/pulls/4919","_links":{"self":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/comments/45917823"},"html":{"href":"https://github.com/sequelize/sequelize/pull/4919#discussion_r45917823"},"pull_request":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/4919"}}},"pull_request":{"url":"https://api.github.com/repos/sequelize/sequelize/pulls/4919","id":51713500,"html_url":"https://github.com/sequelize/sequelize/pull/4919","diff_url":"https://github.com/sequelize/sequelize/pull/4919.diff","patch_url":"https://github.com/sequelize/sequelize/pull/4919.patch","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/4919","number":4919,"state":"open","locked":false,"title":"[MSSQL] Fix connection manager domain usage","user":{"login":"lukealbao","id":3156841,"avatar_url":"https://avatars.githubusercontent.com/u/3156841?v=3","gravatar_id":"","url":"https://api.github.com/users/lukealbao","html_url":"https://github.com/lukealbao","followers_url":"https://api.github.com/users/lukealbao/followers","following_url":"https://api.github.com/users/lukealbao/following{/other_user}","gists_url":"https://api.github.com/users/lukealbao/gists{/gist_id}","starred_url":"https://api.github.com/users/lukealbao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukealbao/subscriptions","organizations_url":"https://api.github.com/users/lukealbao/orgs","repos_url":"https://api.github.com/users/lukealbao/repos","events_url":"https://api.github.com/users/lukealbao/events{/privacy}","received_events_url":"https://api.github.com/users/lukealbao/received_events","type":"User","site_admin":false},"body":"API for the Tedious driver requires that an entry for `domain`, if present,\r\nbe at the root level of the config option passed to the constructor. This\r\nwas added in commit 91fc76be10b12e0e5a2c4a9299e5bc05a2956d58.\r\n\r\nHowever, that commit deleted `dialectOptions.domain` from the config object\r\npassed into the Sequelize constructor. Since most config objects are singletons,\r\nthis mutation of the config object breaks any subsequent calls to the instance's\r\n`connectionManager.$connect`.\r\n\r\nThis commit simply removes the call to delete the domain entry.\r\nFixes #4918","created_at":"2015-11-24T20:36:23Z","updated_at":"2015-11-25T20:53:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eabf365ac40639caf55e88664fabd898d4ca89e8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sequelize/sequelize/pulls/4919/commits","review_comments_url":"https://api.github.com/repos/sequelize/sequelize/pulls/4919/comments","review_comment_url":"https://api.github.com/repos/sequelize/sequelize/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/4919/comments","statuses_url":"https://api.github.com/repos/sequelize/sequelize/statuses/c26aba59e873cd6e437729f3967144b1e6db0b62","head":{"label":"lukealbao:master","ref":"master","sha":"c26aba59e873cd6e437729f3967144b1e6db0b62","user":{"login":"lukealbao","id":3156841,"avatar_url":"https://avatars.githubusercontent.com/u/3156841?v=3","gravatar_id":"","url":"https://api.github.com/users/lukealbao","html_url":"https://github.com/lukealbao","followers_url":"https://api.github.com/users/lukealbao/followers","following_url":"https://api.github.com/users/lukealbao/following{/other_user}","gists_url":"https://api.github.com/users/lukealbao/gists{/gist_id}","starred_url":"https://api.github.com/users/lukealbao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukealbao/subscriptions","organizations_url":"https://api.github.com/users/lukealbao/orgs","repos_url":"https://api.github.com/users/lukealbao/repos","events_url":"https://api.github.com/users/lukealbao/events{/privacy}","received_events_url":"https://api.github.com/users/lukealbao/received_events","type":"User","site_admin":false},"repo":{"id":46812882,"name":"sequelize","full_name":"lukealbao/sequelize","owner":{"login":"lukealbao","id":3156841,"avatar_url":"https://avatars.githubusercontent.com/u/3156841?v=3","gravatar_id":"","url":"https://api.github.com/users/lukealbao","html_url":"https://github.com/lukealbao","followers_url":"https://api.github.com/users/lukealbao/followers","following_url":"https://api.github.com/users/lukealbao/following{/other_user}","gists_url":"https://api.github.com/users/lukealbao/gists{/gist_id}","starred_url":"https://api.github.com/users/lukealbao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukealbao/subscriptions","organizations_url":"https://api.github.com/users/lukealbao/orgs","repos_url":"https://api.github.com/users/lukealbao/repos","events_url":"https://api.github.com/users/lukealbao/events{/privacy}","received_events_url":"https://api.github.com/users/lukealbao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lukealbao/sequelize","description":"Sequelize is an easy-to-use multi sql dialect ORM for Node.js & io.js. It currently supports MySQL, MariaDB, SQLite, PostgreSQL and MSSQL.","fork":true,"url":"https://api.github.com/repos/lukealbao/sequelize","forks_url":"https://api.github.com/repos/lukealbao/sequelize/forks","keys_url":"https://api.github.com/repos/lukealbao/sequelize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lukealbao/sequelize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lukealbao/sequelize/teams","hooks_url":"https://api.github.com/repos/lukealbao/sequelize/hooks","issue_events_url":"https://api.github.com/repos/lukealbao/sequelize/issues/events{/number}","events_url":"https://api.github.com/repos/lukealbao/sequelize/events","assignees_url":"https://api.github.com/repos/lukealbao/sequelize/assignees{/user}","branches_url":"https://api.github.com/repos/lukealbao/sequelize/branches{/branch}","tags_url":"https://api.github.com/repos/lukealbao/sequelize/tags","blobs_url":"https://api.github.com/repos/lukealbao/sequelize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lukealbao/sequelize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lukealbao/sequelize/git/refs{/sha}","trees_url":"https://api.github.com/repos/lukealbao/sequelize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lukealbao/sequelize/statuses/{sha}","languages_url":"https://api.github.com/repos/lukealbao/sequelize/languages","stargazers_url":"https://api.github.com/repos/lukealbao/sequelize/stargazers","contributors_url":"https://api.github.com/repos/lukealbao/sequelize/contributors","subscribers_url":"https://api.github.com/repos/lukealbao/sequelize/subscribers","subscription_url":"https://api.github.com/repos/lukealbao/sequelize/subscription","commits_url":"https://api.github.com/repos/lukealbao/sequelize/commits{/sha}","git_commits_url":"https://api.github.com/repos/lukealbao/sequelize/git/commits{/sha}","comments_url":"https://api.github.com/repos/lukealbao/sequelize/comments{/number}","issue_comment_url":"https://api.github.com/repos/lukealbao/sequelize/issues/comments{/number}","contents_url":"https://api.github.com/repos/lukealbao/sequelize/contents/{+path}","compare_url":"https://api.github.com/repos/lukealbao/sequelize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lukealbao/sequelize/merges","archive_url":"https://api.github.com/repos/lukealbao/sequelize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lukealbao/sequelize/downloads","issues_url":"https://api.github.com/repos/lukealbao/sequelize/issues{/number}","pulls_url":"https://api.github.com/repos/lukealbao/sequelize/pulls{/number}","milestones_url":"https://api.github.com/repos/lukealbao/sequelize/milestones{/number}","notifications_url":"https://api.github.com/repos/lukealbao/sequelize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lukealbao/sequelize/labels{/name}","releases_url":"https://api.github.com/repos/lukealbao/sequelize/releases{/id}","created_at":"2015-11-24T19:14:20Z","updated_at":"2015-11-24T19:14:24Z","pushed_at":"2015-11-24T20:35:14Z","git_url":"git://github.com/lukealbao/sequelize.git","ssh_url":"git@github.com:lukealbao/sequelize.git","clone_url":"https://github.com/lukealbao/sequelize.git","svn_url":"https://github.com/lukealbao/sequelize","homepage":"http://sequelizejs.com","size":16395,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sequelize:master","ref":"master","sha":"f482790b85ef2336bb97893c0eaa127d9d6bbc77","user":{"login":"sequelize","id":3591786,"avatar_url":"https://avatars.githubusercontent.com/u/3591786?v=3","gravatar_id":"","url":"https://api.github.com/users/sequelize","html_url":"https://github.com/sequelize","followers_url":"https://api.github.com/users/sequelize/followers","following_url":"https://api.github.com/users/sequelize/following{/other_user}","gists_url":"https://api.github.com/users/sequelize/gists{/gist_id}","starred_url":"https://api.github.com/users/sequelize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sequelize/subscriptions","organizations_url":"https://api.github.com/users/sequelize/orgs","repos_url":"https://api.github.com/users/sequelize/repos","events_url":"https://api.github.com/users/sequelize/events{/privacy}","received_events_url":"https://api.github.com/users/sequelize/received_events","type":"Organization","site_admin":false},"repo":{"id":790359,"name":"sequelize","full_name":"sequelize/sequelize","owner":{"login":"sequelize","id":3591786,"avatar_url":"https://avatars.githubusercontent.com/u/3591786?v=3","gravatar_id":"","url":"https://api.github.com/users/sequelize","html_url":"https://github.com/sequelize","followers_url":"https://api.github.com/users/sequelize/followers","following_url":"https://api.github.com/users/sequelize/following{/other_user}","gists_url":"https://api.github.com/users/sequelize/gists{/gist_id}","starred_url":"https://api.github.com/users/sequelize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sequelize/subscriptions","organizations_url":"https://api.github.com/users/sequelize/orgs","repos_url":"https://api.github.com/users/sequelize/repos","events_url":"https://api.github.com/users/sequelize/events{/privacy}","received_events_url":"https://api.github.com/users/sequelize/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sequelize/sequelize","description":"Sequelize is an easy-to-use multi sql dialect ORM for Node.js & io.js. It currently supports MySQL, MariaDB, SQLite, PostgreSQL and MSSQL.","fork":false,"url":"https://api.github.com/repos/sequelize/sequelize","forks_url":"https://api.github.com/repos/sequelize/sequelize/forks","keys_url":"https://api.github.com/repos/sequelize/sequelize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sequelize/sequelize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sequelize/sequelize/teams","hooks_url":"https://api.github.com/repos/sequelize/sequelize/hooks","issue_events_url":"https://api.github.com/repos/sequelize/sequelize/issues/events{/number}","events_url":"https://api.github.com/repos/sequelize/sequelize/events","assignees_url":"https://api.github.com/repos/sequelize/sequelize/assignees{/user}","branches_url":"https://api.github.com/repos/sequelize/sequelize/branches{/branch}","tags_url":"https://api.github.com/repos/sequelize/sequelize/tags","blobs_url":"https://api.github.com/repos/sequelize/sequelize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sequelize/sequelize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sequelize/sequelize/git/refs{/sha}","trees_url":"https://api.github.com/repos/sequelize/sequelize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sequelize/sequelize/statuses/{sha}","languages_url":"https://api.github.com/repos/sequelize/sequelize/languages","stargazers_url":"https://api.github.com/repos/sequelize/sequelize/stargazers","contributors_url":"https://api.github.com/repos/sequelize/sequelize/contributors","subscribers_url":"https://api.github.com/repos/sequelize/sequelize/subscribers","subscription_url":"https://api.github.com/repos/sequelize/sequelize/subscription","commits_url":"https://api.github.com/repos/sequelize/sequelize/commits{/sha}","git_commits_url":"https://api.github.com/repos/sequelize/sequelize/git/commits{/sha}","comments_url":"https://api.github.com/repos/sequelize/sequelize/comments{/number}","issue_comment_url":"https://api.github.com/repos/sequelize/sequelize/issues/comments{/number}","contents_url":"https://api.github.com/repos/sequelize/sequelize/contents/{+path}","compare_url":"https://api.github.com/repos/sequelize/sequelize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sequelize/sequelize/merges","archive_url":"https://api.github.com/repos/sequelize/sequelize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sequelize/sequelize/downloads","issues_url":"https://api.github.com/repos/sequelize/sequelize/issues{/number}","pulls_url":"https://api.github.com/repos/sequelize/sequelize/pulls{/number}","milestones_url":"https://api.github.com/repos/sequelize/sequelize/milestones{/number}","notifications_url":"https://api.github.com/repos/sequelize/sequelize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sequelize/sequelize/labels{/name}","releases_url":"https://api.github.com/repos/sequelize/sequelize/releases{/id}","created_at":"2010-07-22T07:11:11Z","updated_at":"2015-11-25T20:29:21Z","pushed_at":"2015-11-24T23:08:28Z","git_url":"git://github.com/sequelize/sequelize.git","ssh_url":"git@github.com:sequelize/sequelize.git","clone_url":"https://github.com/sequelize/sequelize.git","svn_url":"https://github.com/sequelize/sequelize","homepage":"http://sequelizejs.com","size":47461,"stargazers_count":5103,"watchers_count":5103,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1112,"mirror_url":null,"open_issues_count":603,"forks":1112,"open_issues":603,"watchers":5103,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/4919"},"html":{"href":"https://github.com/sequelize/sequelize/pull/4919"},"issue":{"href":"https://api.github.com/repos/sequelize/sequelize/issues/4919"},"comments":{"href":"https://api.github.com/repos/sequelize/sequelize/issues/4919/comments"},"review_comments":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/4919/comments"},"review_comment":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/4919/commits"},"statuses":{"href":"https://api.github.com/repos/sequelize/sequelize/statuses/c26aba59e873cd6e437729f3967144b1e6db0b62"}}}}