Skip to content

Commit 940bdbc

Browse files
committed
[misc] test correction for recent MySQL 8 that add a new error when plugin is unknown by client
1 parent d068ce5 commit 940bdbc

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

test/integration/test-change-user.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@ const Conf = require('../conf');
88
describe('change user', () => {
99
before(done => {
1010
shareConn.query("CREATE USER ChangeUser@'%' IDENTIFIED BY 'm1P4ssw0@rd'");
11-
shareConn.query(
12-
"GRANT ALL PRIVILEGES ON *.* TO ChangeUser@'%' IDENTIFIED BY 'm1P4ssw0@rd' with grant option"
13-
);
11+
shareConn.query("GRANT ALL PRIVILEGES ON *.* TO ChangeUser@'%' with grant option");
1412
shareConn.query("CREATE USER ChangeUser2@'%' IDENTIFIED BY 'm1SecondP@rd'");
15-
shareConn.query(
16-
"GRANT ALL PRIVILEGES ON *.* TO ChangeUser2@'%' IDENTIFIED BY 'm1SecondP@rd' with grant option"
17-
);
13+
shareConn.query("GRANT ALL PRIVILEGES ON *.* TO ChangeUser2@'%' with grant option");
1814
shareConn
1915
.query('FLUSH PRIVILEGES')
2016
.then(() => done())

test/integration/test-connection.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,12 @@ describe('connection', () => {
190190
done();
191191
});
192192
conn.query('KILL ' + conn.threadId).catch(err => {
193-
assert.isTrue(err.message.includes('Connection was killed'));
193+
assert.isTrue(
194+
err.message.includes('Connection was killed') ||
195+
err.message.includes('Query execution was interrupted')
196+
);
194197
assert.equal(err.sqlState, '70100');
195-
assert.equal(err.errno, 1927);
198+
assert.isTrue(err.errno === 1927 || err.errno === 1317);
196199
});
197200
})
198201
.catch(done);
@@ -564,6 +567,11 @@ describe('connection', () => {
564567
conn.connect(err => {
565568
if (!err) done(new Error('must have thrown error'));
566569
switch (err.errno) {
570+
case 45025:
571+
//Client does not support authentication protocol
572+
assert.equal(err.sqlState, '08004');
573+
break;
574+
567575
case 1251:
568576
//authentication method unavailable
569577
assert.equal(err.sqlState, '08004');
@@ -603,6 +611,11 @@ describe('connection', () => {
603611
})
604612
.catch(err => {
605613
switch (err.errno) {
614+
case 45025:
615+
//Client does not support authentication protocol
616+
assert.equal(err.sqlState, '08004');
617+
break;
618+
606619
case 1251:
607620
//authentication method unavailable
608621
assert.equal(err.sqlState, '08004');

0 commit comments

Comments
 (0)