-
Notifications
You must be signed in to change notification settings - Fork 2
Support Percona MySQL 8 #13
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
base: master
Are you sure you want to change the base?
Conversation
To be honest, it is hard to review due to lots of code style changes. I would extract them into a separate commit(s). |
@Totktonada, reverted code style changes |
@ParshinPavel, we are fixed CI in a master. Could you rebase your patch? |
@ligurio, done |
@ParshinPavel I still see changes for Travis in your patch - https://patch-diff.githubusercontent.com/raw/tarantool/libslave/pull/13.patch And GH also warns about conflicts in this PR (see at the bottom of PR page). |
@ligurio , i have no idea why github generates patch including all commits. If you open tab "Files changed", you see the real diff. If you wish, I can just squash all commits and force push |
@ParshinPavel perhaps that happens because you did a merge and not a rebase: see commits in your own branch - https://github.com/ParshinPavel/libslave/commits/support-mysql8 You should drop your travis-related commits from a branch and then push updated commits with |
5c10617
to
3b9d523
Compare
3b9d523
to
712f6f6
Compare
Hope it's better now |
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.
It is definitely better, thank you!
I have some comments regarding your changes. Please check them inline and below:
- You have mixed several changes in a single commit (formatting changes in
.travis.yml
andCMakeLists.txt
, changes in a build infrastructure and changes related to support of Percona 8). It's a bad practice. I would ask you to split changes for a several commits and probably remove formatting changes when you don't need to change code (although it's up to you). - You have bumped a submodule version to a branch with 8th version. I'm not sure it's a good idea. I would ask you to stick module to a fixed tag or commit to have predictable result each time when we will rebuild library.
We can stick it to a commit of a latest tag in 8th series:
$ git tag | grep Percona-Server-8.0 | tail -1
Percona-Server-8.0.20-11
$ git rev-list -n 1 Percona-Server-8.0.20-11
5b5a5d2584af8e47a66248218be0288164a69cb7
@@ -41,7 +41,7 @@ before_install: | |||
before_script: | |||
- mkdir build | |||
- cd build | |||
- cmake -DCMAKE_BUILD_TYPE=Release .. |
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.
This change is not related to PR with Percona 8 support. Please remove it.
This raises the question: can we support different mysql versions in future? How about mariadb? Can we support different versions in one build with appropriate runtime checks? |
MariaDB has incompatible replication protocol [1]. It was never supported in libslave. If you (or any user) wants MariaDB support |
@@ -117,7 +117,7 @@ const char* Field_decimal::unpack(const char *from) | |||
int value_length = decimal_string_size(&dec); | |||
char buffer[ value_length ]; | |||
|
|||
if (::decimal2string(&dec, (char*)&buffer, &value_length, zerofill ? precision : 0, scale, '0') != E_DEC_OK) { | |||
if (::decimal2string(&dec, (char*)&buffer, &value_length, zerofill ? precision : 0, scale) != E_DEC_OK) { |
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.
There are at least two supported versions of MySQL: 5.7 and 8.0 [1] [2]. This change will add compatibility with 8.x and will broke compatibility with 5.7. Perhaps we need to introduce a compilation flag (for example MYSQL57
, MYSQL80
) and pass it to cmake before a build.
-DCMAKE_BUILD_TYPE=Release | ||
-DDISABLE_SHARED=1 | ||
-DENABLED_PROFILING=0 | ||
-DWITHOUT_SERVER=1 | ||
-DWITH_CLIENT_PROTOCOL_TRACING=0 | ||
-DWITH_DEFAULT_FEATURE_SET=0 | ||
-DWITH_SSL=bundled | ||
-DWITH_SSL=system |
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.
What are the reasons to change it?
mysqlclient_build | ||
WORKING_DIRECTORY ${MYSQL_BIN} | ||
DEPENDS mysql_configure | ||
COMMAND ${CMAKE_COMMAND} --build . --target perconaserverclient | ||
binlogevents_build | ||
WORKING_DIRECTORY ${MYSQL_BIN} | ||
DEPENDS mysql_configure | ||
COMMAND ${CMAKE_COMMAND} --build . --target binlogevents_static | ||
) | ||
|
||
ADD_CUSTOM_TARGET ( | ||
binlogevents_build | ||
WORKING_DIRECTORY ${MYSQL_BIN} | ||
DEPENDS mysql_configure | ||
COMMAND ${CMAKE_COMMAND} --build . --target binlogevents_static | ||
mysql_client_build | ||
WORKING_DIRECTORY ${MYSQL_BIN} | ||
DEPENDS binlogevents_build | ||
COMMAND ${CMAKE_COMMAND} --build . --target perconaserverclient |
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.
It seems it's a formatting change and it is not related to Percona 8 support. Please remove it.
ADD_LIBRARY (slave ${LINK_TYPE} ${SRC}) | ||
TARGET_LINK_LIBRARIES (slave ${MYSQL_LIBS} -lpthread) | ||
TARGET_LINK_LIBRARIES (slave PUBLIC libmysql ssl crypto Threads::Threads m rt dl) |
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.
What are the reasons to remove MYSQL_LIBS here?
START_5_7_ENCRYPTION_EVENT = 159, | ||
|
||
MARIA_EVENTS_BEGIN = 160, | ||
|
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.
libslave
has a unit test (test/unit_test.cpp
) that covers different types of events. It would be good to add new testcases for a new event types.
@@ -381,6 +381,9 @@ bool read_log_event(const char* buf, uint event_len, Basic_event_info& bei, Even | |||
case TRANSACTION_CONTEXT_EVENT: | |||
case VIEW_CHANGE_EVENT: | |||
case XA_PREPARE_LOG_EVENT: | |||
case PARTIAL_UPDATE_ROWS_EVENT: | |||
case START_5_7_ENCRYPTION_EVENT: |
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.
Looks like event MYSQL_END_EVENT
added to slave_log_event.h
is missed here.
07ebc98
to
712f6f6
Compare
This MR updates mysql submodule, fixes some compilation/linking errors