Files
MaxScale/maxscale-system-test/mxs2464_sescmd_reconnect.cpp
Markus Mäkelä 13b258a151 MXS-2464: Add test case
The bug appears when a session command that is executed on the master
fails. The logic in the code doesn't take this case into consideration
when it processes failed connections.
2019-05-31 14:01:15 +03:00

36 lines
1017 B
C++

/**
* MXS-2464: Crash in route_stored_query with ReadWriteSplit
* https://jira.mariadb.org/browse/MXS-2464
*/
#include "testconnections.h"
int main(int argc, char* argv[])
{
TestConnections test(argc, argv);
test.maxscales->connect();
std::thread thr([&]() {
sleep(5);
test.tprintf("block node 0");
test.repl->block_node(0);
test.tprintf("wait for monitor");
test.maxscales->wait_for_monitor(2);
test.tprintf("unblock node 0");
test.repl->unblock_node(0);
});
constexpr const char* query = "SET @a = (SELECT SLEEP(10))";
test.set_timeout(60);
test.tprintf("%s", query);
test.try_query(test.maxscales->conn_rwsplit[0], query);
test.stop_timeout();
test.tprintf("disconnect");
test.maxscales->disconnect();
test.tprintf("join");
thr.join();
return test.global_result;
}