| 37 | } |
| 38 | |
| 39 | function assertNewConnection(newConnection, oldConnection) { |
| 40 | switch (dialect) { |
| 41 | case 'postgres': |
| 42 | expect(oldConnection.processID).to.not.be.equal(newConnection.processID); |
| 43 | break; |
| 44 | |
| 45 | case 'mariadb': |
| 46 | case 'mysql': |
| 47 | expect(oldConnection.threadId).to.not.be.equal(newConnection.threadId); |
| 48 | break; |
| 49 | |
| 50 | case 'db2': |
| 51 | expect(newConnection.connected).to.be.ok; |
| 52 | expect(oldConnection.connected).to.not.be.ok; |
| 53 | break; |
| 54 | |
| 55 | case 'oracle': |
| 56 | expect(oldConnection).to.not.be.equal(newConnection); |
| 57 | break; |
| 58 | |
| 59 | case 'mssql': |
| 60 | // Flaky test |
| 61 | expect(newConnection.dummyId).to.not.be.ok; |
| 62 | expect(oldConnection.dummyId).to.be.ok; |
| 63 | break; |
| 64 | |
| 65 | default: |
| 66 | throw new Error('Unsupported dialect'); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | function attachMSSQLUniqueId(connection) { |
| 71 | if (dialect === 'mssql') { |