-
Notifications
You must be signed in to change notification settings - Fork 337
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
Exception when reading TEXT type from ProxySQL #842
Comments
If you're able to make a non-SSL connection to ProxySQL ( It looks like the This code could certainly be a bit more defensive towards unexpected/malformed data, but I'd be interested in knowing more details before simply ignoring what's there (or not there, in this case). |
I've attached a tcpdump which ends with the exception being thrown. It is running a simple Please let me know if you need further diagnostics or logs. |
This looks like a protocol bug in ProxySQL. In packet 268, the server sends an initial handshake and sets the In packet 278, ProxySQL sends an OK packet that sets According to the OK payload documentation, if MySqlConnector reads past the end of the packet, and crashes. MySqlConnector could certainly be more robust in the face of bad server data, but I would like to get this bug reported and confirmed upstream, just to confirm that I'm reading the protocol documentation correctly. |
The client implementation in mysql-server protects all reads of this extra OK packet information by checking the length of the packet, despite the server flags: https://github.com/mysql/mysql-server/blob/7d10c82196c8e45554f27c00681474a9fb86d137/sql-common/client.cc#L809-L831 |
Thanks so much for investigating. Based on your edit/followup, it sounds like this could (should, if favouring compatibility) be "fixed" locally, but may be something ProxySQL should be made aware of regardless. Let me know if you would prefer I report it to ProxySQL or if you are planning to do so yourself (your better knowledge of the protocol may put you in a better position to submit a bug report if you are willing!). |
@peppy I just finished writing up a ProxySQL bug report: sysown/proxysql#2915. Please do add any supporting info there that you think might be helpful (OS info/distribution, ProxySQL version, MySQL version, etc.). |
Be more robust when a server sets a flag that implies the existence of extra data, but doesn't actually send the data.
@peppy I've added a potential fix for this in 0.69.5; please test it and let me know if it works for you. |
Can confirm it's fixed in 0.69.5, thanks again! |
I have recently switched to using ProxySQL in front of my mysql database instances, and noticed that one of many of my deployed projects using MySqlConnector started to intermittently fail.
A query
SELECT
ing a field of typetext COLLATE utf8_bin NOT NULL
is hitting the following exception:code:
exception:
To make things more interesting, this only happens when using a specific mysql database user. The user which causes the issue is also in use on a different high load application which also uses MySqlConnector (latest version in both cases).
Running the same query from a CLI mysql client does not seem to cause any unexpected issue. The other application using the same user makes use of
MySqlDataAdapter
andMySqlCommand
, if that helps pinpoint in any way.To reiterate, this only happens with the
text
type. Other queries accessingvarchar
or number types never hit this same issue.I understand this is likely going to take a bit of investigating, but am posting before I have a complete grasp of the situation in case anyone is able to more easily understand what is going on. My next step will be to get MySqlConnector in a debuggable state to see what the underlying data looks like.
The text was updated successfully, but these errors were encountered: