-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
server: fix connection reset caused by alias length overflow #14870
Conversation
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.
LGTM, please fix lint
7a4c5e7
to
74281ef
Compare
Codecov Report
@@ Coverage Diff @@
## master #14870 +/- ##
================================================
+ Coverage 80.2213% 80.3066% +0.0853%
================================================
Files 503 503
Lines 130853 131100 +247
================================================
+ Hits 104972 105282 +310
+ Misses 17573 17532 -41
+ Partials 8308 8286 -22 |
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.
LGTM
/merge |
Your auto merge job has been accepted, waiting for 14769 |
/run-all-tests |
cherry pick to release-3.0 failed |
What problem does this PR solve?
Clients using binary protocol like PDO of PHP or JDBC, may occur error when query with very long alias, just like
select (a very long if else expression) from t;
This is because the maxium size of column alias in mysql protocol is 256, but TiDB will return the long alias directly, MySQL will cut it until its less than 256 bytes.
https://dev.mysql.com/doc/refman/8.0/en/identifier-length.html
What is changed and how it works?
cut the name dump to 256 bytes.
Check List
Tests
Code changes
Side effects
Related changes
Release note