MXS-1828: Create test case
Created a test case that performs two LOAD DATA LOCAL INFILE statements in one query. Currently, the test will fail as the issue is not resolved.
This commit is contained in:
parent
9ef1ffa878
commit
dc4086b182
@ -705,6 +705,10 @@ add_test_executable(mxs1808_long_data.cpp mxs1808_long_data replication LABELS r
|
||||
# https://jira.mariadb.org/browse/MXS-1824
|
||||
add_test_executable(mxs1824_double_cursor.cpp mxs1824_double_cursor replication LABELS readwritesplit REPL_BACKEND)
|
||||
|
||||
# MXS-1828: Multiple LOAD DATA LOCAL INFILE commands in one query cause a hang
|
||||
# https://jira.mariadb.org/browse/MXS-1828
|
||||
add_test_executable(mxs1828_double_local_infile.cpp mxs1828_double_local_infile replication LABELS readwritesplit REPL_BACKEND)
|
||||
|
||||
# MXS-1831: No error on invalid monitor parameter alteration
|
||||
# https://jira.mariadb.org/browse/MXS-1831
|
||||
add_test_executable(mxs1831_unknown_param.cpp mxs1831_unknown_param replication LABELS REPL_BACKEND)
|
||||
|
36
maxscale-system-test/mxs1828_double_local_infile.cpp
Normal file
36
maxscale-system-test/mxs1828_double_local_infile.cpp
Normal file
@ -0,0 +1,36 @@
|
||||
/**
|
||||
* MXS-1828: Multiple LOAD DATA LOCAL INFILE commands in one query cause a hang
|
||||
*
|
||||
* https://jira.mariadb.org/browse/MXS-1828
|
||||
*/
|
||||
|
||||
#include "testconnections.h"
|
||||
#include <fstream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
TestConnections test(argc, argv);
|
||||
|
||||
const char* query = "LOAD DATA LOCAL INFILE './data.csv' INTO TABLE test.t1";
|
||||
const char* filename = "./data.csv";
|
||||
|
||||
unlink(filename);
|
||||
ofstream file(filename);
|
||||
|
||||
file << "1\n2\n3" << endl;
|
||||
|
||||
test.set_timeout(30);
|
||||
test.maxscales->connect();
|
||||
test.try_query(test.maxscales->conn_rwsplit[0], "CREATE TABLE test.t1(id INT)");
|
||||
test.try_query(test.maxscales->conn_rwsplit[0], "%s;%s", query, query);
|
||||
|
||||
Row row = get_row(test.maxscales->conn_rwsplit[0], "SELECT COUNT(*) FROM test.t1");
|
||||
test.assert(!row.empty() && row[0] == "6", "Both queries should be executed");
|
||||
test.try_query(test.maxscales->conn_rwsplit[0], "DROP TABLE test.t1");
|
||||
test.maxscales->disconnect();
|
||||
|
||||
unlink(filename);
|
||||
return test.global_result;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user