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

Set MULTI_RESULTS and MULTI_STATEMENTS MySQL client CAP #12690

Merged
merged 5 commits into from
May 20, 2022

Conversation

smallinsky
Copy link
Contributor

@smallinsky smallinsky commented May 17, 2022

What

Preset CLIENT_MULTI_RESULTS and CLIENT_MULTI_STATEMENTS client capabilities when connecting to mysql instance.

Why

Those caps requested and set to conn.SetCapability() https://github.com/gravitational/go-mysql/blob/smallinsky/v1.5.0-teleport.1/client/auth.go#L181 function to take effect.

capability |= c.ccaps&CLIENT_MULTI_STATEMENTS | c.ccaps&CLIENT_MULTI_RESULTS |

@smallinsky smallinsky requested review from r0mant, greedy52 and jakule May 17, 2022 08:53
@smallinsky smallinsky marked this pull request as ready for review May 17, 2022 08:53
@github-actions github-actions bot requested review from espadolini and hatched May 17, 2022 08:53
@github-actions github-actions bot added the database-access Database access related issues and PRs label May 17, 2022
Copy link
Contributor

@jakule jakule left a comment

Choose a reason for hiding this comment

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

@smallinsky Any reason why we hardcode the options instead of forwarding them from the client? AFAIR we're already doing something similar with Postgres, so it shouldn't be hard to implement.

@smallinsky
Copy link
Contributor Author

Any reason why we hardcode the options instead of forwarding them from the client? AFAIR we're already doing something similar with Postgres, so it shouldn't be hard to implement.

The client cap are obtained in teleport proxy where connection to upstream server is done in teleport db agent. Teleport agent and proxy speaks raw TCP thus right now the only way to propagate client capability is to encode them in client TLS identity.
In Progres case the capability are propagated by StartupMessage message that are send for db client thought teleport proxy and can be received by db agent. In mysql the client/server capabilities are propagated in MySQL Handshake so there is no easy way just forward them.

@smallinsky smallinsky changed the base branch from smallinsky/mysql-driver-upgrade to master May 18, 2022 09:27
@smallinsky smallinsky changed the base branch from master to smallinsky/mysql-driver-upgrade May 18, 2022 09:28
@smallinsky smallinsky changed the base branch from smallinsky/mysql-driver-upgrade to master May 18, 2022 10:10
@github-actions
Copy link

@smallinsky See the table below for backport results.

Branch Result
branch/v8 Failed
branch/v9 Failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database-access Database access related issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants