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

Support for latest Connector/J 8.0.22 #14

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

rnbguy
Copy link
Contributor

@rnbguy rnbguy commented Dec 7, 2020

This should fix mit-pdos/noria-mysql#15

@rnbguy
Copy link
Contributor Author

rnbguy commented Dec 7, 2020

My apologies. I didn't cargo test before the pull request. I am on it.

@jonhoo
Copy link
Owner

jonhoo commented Dec 8, 2020

Thank you for digging into this! I'll give it a read now \o/

@@ -238,15 +238,22 @@ impl<B: MysqlShim<W>, R: Read, W: Write> MysqlIntermediary<B, R, W> {
fn init(&mut self) -> Result<(), B::Error> {
self.writer.write_all(&[10])?; // protocol 10

let mut capabilities = CapabilityFlags::empty();
capabilities.insert(CapabilityFlags::CLIENT_PROTOCOL_41);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the handshake change the only difference with the 4.1 protocol?

@@ -238,15 +238,22 @@ impl<B: MysqlShim<W>, R: Read, W: Write> MysqlIntermediary<B, R, W> {
fn init(&mut self) -> Result<(), B::Error> {
self.writer.write_all(&[10])?; // protocol 10

let mut capabilities = CapabilityFlags::empty();
capabilities.insert(CapabilityFlags::CLIENT_PROTOCOL_41);
capabilities.insert(CapabilityFlags::CLIENT_RESERVED);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does setting this do? Aren't generally reserved flags supposed to be 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It came from default capabilities flags. Here you set it.

self.writer.write_all(&[0x00, 0x42])?; // just 4.1 proto

It should be 0x02 if you only meant CLIENT_PROTOCOL_41.

let mut capabilities = CapabilityFlags::empty();
capabilities.insert(CapabilityFlags::CLIENT_PROTOCOL_41);
capabilities.insert(CapabilityFlags::CLIENT_RESERVED);
capabilities.insert(CapabilityFlags::CLIENT_SECURE_CONNECTION);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually support secure connections? I did not think so?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't. But those two are the minimal sets of flags that fixed the connection phase issue with the latest Connector/J. But I have to fix the client authentication problem.

capabilities.insert(CapabilityFlags::CLIENT_PROTOCOL_41);
capabilities.insert(CapabilityFlags::CLIENT_RESERVED);
capabilities.insert(CapabilityFlags::CLIENT_SECURE_CONNECTION);
capabilities.insert(CapabilityFlags::CLIENT_PLUGIN_AUTH);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What makes it so that we support plugin auths?

@jonhoo
Copy link
Owner

jonhoo commented Dec 8, 2020

This generally looks great subject to the tests passing and the comments I left above!

flaneur2020 pushed a commit to flaneur2020/msql-srv that referenced this pull request Jan 17, 2022
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.

Java application can not use noria-mysql adapter
2 participants