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

Expose db attribute of MYSQL client struct #1244

Closed

Conversation

richardlarocque
Copy link

Adds an accessor method that returns the current value of the MSYQL
client struct's db attribute.

The MYSQL client struct includes a field char *db. When the
session_track_schema setting is enabled, this field will be updated
using information from server-provided "OK" packets, keeping it in sync
as the client switches between databases.

Adds an accessor method that returns the current value of the `MSYQL`
client struct's `db` attribute.

The `MYSQL` client struct includes a field `char *db`.  When the
`session_track_schema` setting is enabled, this field will be updated
using information from server-provided "OK" packets, keeping it in sync
as the client switches between databases.
@richardlarocque
Copy link
Author

Sorry, I did not mean to open this against brianmario's repo at this time. I'll close for now. Apologies for the noise.

@sodabrew
Copy link
Collaborator

This looks useful, I'd be glad to review and merge.

@richardlarocque
Copy link
Author

Thanks, @sodabrew! I'm glad you think so.

I'm still figuring out how this works by reading source code. I haven't found a lot of official documentation.

I think this will break if session tracking is turned off. If so, this method needs a warning label. I want to test and document it properly.

I'm hoping to come back with a PR that includes better documentation and unit tests in a few days.

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