-
Notifications
You must be signed in to change notification settings - Fork 977
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3807 from sysown/v2.x-3583
Resolves #3583 - Session fast forward enabled when COM_BINLOG_DUMP_GTID is received
- Loading branch information
Showing
4 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
test/tap/tests/test_com_binlog_dump_enables_fast_forward-t.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* @file test_com_binlog_dump_enables_fast_forward-t.cpp | ||
* @brief Test COM_BINLOG_DUMP enables fast forward. | ||
* @details Test checks if mysqlbinlog is executed successfully using a user | ||
* with fast forward flag set to false. mysqlginlog sends command | ||
* COM_BINLOG_DUMP, then ProxySQL enables fast forward. | ||
*/ | ||
|
||
#include "tap.h" | ||
#include "command_line.h" | ||
|
||
int main(int argc, char** argv) { | ||
CommandLine cl; | ||
|
||
if (cl.getEnv()) { | ||
diag("Failed to get the required environmental variables."); | ||
return -1; | ||
} | ||
|
||
const std::string user = "root"; | ||
const std::string test_deps_path = getenv("TEST_DEPS"); | ||
|
||
const int mysqlbinlog_res = system((test_deps_path + "/mysqlbinlog mysql1-bin.000001 " | ||
"--read-from-remote-server --user " + user + " --password=" + user + | ||
" --host 127.0.0.1 --port 6033").c_str()); | ||
ok(mysqlbinlog_res == 0, "'mysqlbinlog' should be correctly executed. Err code was: %d", mysqlbinlog_res); | ||
|
||
return exit_status(); | ||
} |
27 changes: 27 additions & 0 deletions
27
test/tap/tests/test_com_register_slave_enables_fast_forward-t.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* @file test_com_register_slave_enables_fast_forward-t.cpp @brief Test | ||
* COM_REGISTER_SLAVE enables fast forward. @details Test checks if | ||
* test_binlog_reader is executed successfully using a user with fast forward | ||
* flag set to false. test_binlog_reader sends command COM_REGISTER_SLAVE, then | ||
* ProxySQL enables fast forward. test_binlog_reader then uses libslave to | ||
* listen binlog events. It listen two times, one after sending a query that do | ||
* not disable multiplexing and the other after sending a query that disables | ||
* multiplexing. | ||
*/ | ||
|
||
#include <string> | ||
|
||
#include "tap.h" | ||
|
||
int main(int argc, char** argv) { | ||
const std::string test_deps_path = getenv("TEST_DEPS"); | ||
|
||
const int test_binlog_reader_res = system((test_deps_path + "/test_binlog_reader-t").c_str()); | ||
ok( | ||
test_binlog_reader_res == 0, | ||
"'test_binlog_reader-t' should be correctly executed. Err code was: %d", | ||
test_binlog_reader_res | ||
); | ||
|
||
return exit_status(); | ||
} |