Skip to content

Support for latest Connector/J 8.0.22#14

Open
rnbguy wants to merge 7 commits intojonhoo:mainfrom
rnbguy:master
Open

Support for latest Connector/J 8.0.22#14
rnbguy wants to merge 7 commits intojonhoo:mainfrom
rnbguy:master

Conversation

@rnbguy
Copy link
Copy Markdown
Contributor

@rnbguy rnbguy commented Dec 7, 2020

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

@rnbguy
Copy link
Copy Markdown
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
Copy Markdown
Owner

jonhoo commented Dec 8, 2020

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

Comment thread src/lib.rs
self.writer.write_all(&[10])?; // protocol 10

let mut capabilities = CapabilityFlags::empty();
capabilities.insert(CapabilityFlags::CLIENT_PROTOCOL_41);
Copy link
Copy Markdown
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?

Comment thread src/lib.rs

let mut capabilities = CapabilityFlags::empty();
capabilities.insert(CapabilityFlags::CLIENT_PROTOCOL_41);
capabilities.insert(CapabilityFlags::CLIENT_RESERVED);
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread src/lib.rs
let mut capabilities = CapabilityFlags::empty();
capabilities.insert(CapabilityFlags::CLIENT_PROTOCOL_41);
capabilities.insert(CapabilityFlags::CLIENT_RESERVED);
capabilities.insert(CapabilityFlags::CLIENT_SECURE_CONNECTION);
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread src/lib.rs
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
Copy Markdown
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
Copy Markdown
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