Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend: always set ClientPluginAuth #222

Merged
merged 3 commits into from
Feb 20, 2023

Conversation

disksing
Copy link
Collaborator

What problem does this PR solve?

Problem Summary:
node client cannot connect to server

test code

var mysql = require('mysql');
var connection = mysql.createConnection({
  host: '127.0.0.1',
  port: 3306,
  user: 'root',
  password: '123456',
  database: 'test',
});
connection.connect(function(err) {
  if (err) {
    throw err
  }
  connection.query('SELECT DATABASE();', function(err, rows) {
    if (err) {
      throw err
    }
    console.log(rows[0]['DATABASE()']);
    connection.end()
  });
})

the cause is that the client does not set capability flags correctly and the connection is terminated by tidb.

What is changed and how it works:

  • always set ClientPluginAuth when connecting backend
  • if client does not set ClientPluginAuth, log a warning

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Notable changes

  • Has configuration change
  • Has HTTP API interfaces change (Don't forget to add the declarative for API)
  • Has tiproxyctl change
  • Other user behavior changes

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
@djshow832 djshow832 merged commit c68bfd3 into pingcap:main Feb 20, 2023
@disksing disksing deleted the disksing/auth branch February 20, 2023 10:10
xhebox pushed a commit to xhebox/TiProxy that referenced this pull request Mar 7, 2023
xhebox pushed a commit to xhebox/TiProxy that referenced this pull request Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants