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
support clickhouse as mysql federated server #7717
support clickhouse as mysql federated server #7717
Conversation
That's very interesting feature! @yurriy will help with review. |
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.
Nice feature. Thanks. Could you please add a test?
Tests of MySQL protocol are here. MySQL server will be started in mysql_client docker container if this line is removed. dbms/tests/integration/README.md.
Hi, @yurriy. Sorry, was on vacation and only now was able to get back to this commit. I've fixed all issues, that you highlighted and added tests. Thanks, |
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.
Note that there were few style check errors, they are listed in "Details" link below.
dbms/tests/integration/test_mysql_protocol/clients/mysql/docker_compose.yml
Outdated
Show resolved
Hide resolved
Hi @yurriy, sorry for stupid mistakes - hadn't written on C++ since university :) I've applied all code review notes, can you please take a look? Thank, |
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.
Hi @yurriy, sorry for stupid mistakes - hadn't written on C++ since university :) I've applied all code review notes, can you please take a look?
Thank,
Max
No worries, you're welcome.
if (0 == strncasecmp("SHOW TABLE STATUS LIKE", query.c_str(), 22)) | ||
{ | ||
should_replace = true; | ||
replacement_query = boost::replace_all_copy(query, "SHOW TABLE STATUS LIKE ", show_table_status_replacement_query); |
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.
Here is LIKE. But in replacement query it is just a string equality.
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.
Fixed.
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category (leave one):
Changelog entry (up to few sentences, not needed for non-significant PRs):
Support adding Clickhouse as MySQL federated server (see https://dev.mysql.com/doc/refman/5.7/en/federated-create-server.html)