Add OK packet processing test

Added a test case which exercises the OK packet handling in
readwritesplit.
This commit is contained in:
Markus Mäkelä 2017-10-09 14:05:38 +03:00 committed by Johan Wikman
parent c70e1431e3
commit f2afa5380b
2 changed files with 31 additions and 0 deletions

View File

@ -295,6 +295,9 @@ add_test_script(load_balancing_pers10 load_balancing load_pers10 LABELS readwrit
# Test with extremely big blob inserting
add_test_executable(longblob.cpp longblob longblob LABELS readwritesplit readconnroute UNSTABLE HEAVY REPL_BACKEND)
# Check that inserts of specific size don't cause a hang
add_test_executable(large_insert_hang.cpp large_insert_hang replication LABELS readwritesplit REPL_BACKEND)
# Test with extremely big blob inserting/selecting with > 16 mb data blocks
add_test_executable(mxs1110_16mb.cpp mxs1110_16mb longblob_filters LABELS readwritesplit readconnroute HEAVY REPL_BACKEND)

View File

@ -0,0 +1,28 @@
/**
* Check that the OK packet flags are read correctly
*/
#include "testconnections.h"
int main(int argc, char *argv[])
{
TestConnections test(argc, argv);
test.set_timeout(60);
test.connect_maxscale();
test.try_query(test.conn_rwsplit, "CREATE OR REPLACE TABLE test.t1(id int)");
std::stringstream ss;
ss << "INSERT INTO test.t1 VALUES (0)";
for (int i = 0; i < 2299; i++)
{
ss << ",(" << i << ")";
}
test.try_query(test.conn_rwsplit, query.str().c_str());
test.try_query(test.conn_rwsplit, "DROP TABLE test.t1");
test.close_maxscale_connections();
return test.global_result;
}