-
Notifications
You must be signed in to change notification settings - Fork 412
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
[Bug Fix] Fix for undefined MySQL library behavior. #2834
Conversation
Gonna change some things up to get rid of the double connection, have to rewrite a bit of db core. Don't merge yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awaiting pointer changes
A few changes, have to test make sure they work. Also I noticed we're not sharing the mutex that protects the connection pointer so have to think up a solution for that. (Sorry it's not all at once I'm doing this as I have time at night) |
…e copy and replaces it with another connection
c1cf998
to
861b688
Compare
Tested booting up all servers, logging in game, everything works as expected |
* MYSQL objects cannot be copied in a well defined way, this removes the copy and replaces it with another connection * Change to share underlying pointers. * Push up mutex changes * Post rebase * Formatting --------- Co-authored-by: KimLS <KimLS@peqtgc.com> Co-authored-by: Akkadius <akkadius1@gmail.com>
The MYSQL structure in the MySQL C api is not copy aware. This isn't enforced because, well, C doesn't enforce anything really.
See: MySQL Structures
This changes the copy of an existing connection to instead create a second backup connection with the same data as what is being copied. This does introduce another connection into the mix which are a limited resource but given the potential seriousness of the bug in question it seems like a fair tradeoff for now.
Long term we can rewrite the dbcore class to use a underlying pointer instead of a pinned in place variable.