MXS-2252: Add test case

Added a test case that verifies the correct user is used.
This commit is contained in:
Markus Mäkelä 2019-01-15 08:50:04 +02:00
parent db98ecbaa1
commit 511f01a28d
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
2 changed files with 22 additions and 0 deletions

View File

@ -153,6 +153,14 @@ public:
int connect(int i, const std::string& db = "test");
int connect(const std::string& db = "test");
/**
* Get a Connection to a node
*/
Connection get_connection(int i, const std::string& db = "test")
{
return Connection(IP[i], port[i], user_name, password, db, ssl);
}
/**
* Repeatedly try to connect with one second sleep in between attempts
*

View File

@ -167,6 +167,20 @@ int main(int argc, char *argv[])
}
}
/**
* MXS-2252: Proxy Protocol not displaying originating IP address in SHOW PROCESSLIST
* https://jira.mariadb.org/browse/MXS-2252
*/
Connection direct = test.repl->get_connection(0);
Connection rwsplit = test.maxscales->rwsplit(0);
direct.connect();
rwsplit.connect();
auto d = direct.field("SELECT USER()");
auto r = rwsplit.field("SELECT USER()");
test.tprintf("Direct: %s Readwritesplit: %s", d.c_str(), r.c_str());
test.expect(d == r, "Both connections should return the same user: %s != %s", d.c_str(), r.c_str());
if (server_proxy_setting)
{
// Restore server settings.