MXS-1896: Distinct LOAD DATA LOCAL INFILE from LOAD DATA INFILE
The two operations return different types of results and need to be treated differently in order for them to be handled correctly in 2.2. This fixes the unexpected internal state errors that happened in all 2.2 versions due to a wrong assumption made by readwritesplit. This fix is not necessary for newer versions as the LOAD DATA LOCAL INFILE processing is done with a simpler, and more robust, method.
This commit is contained in:
32
maxscale-system-test/mxs1896_load_data_infile.cpp
Normal file
32
maxscale-system-test/mxs1896_load_data_infile.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
/**
|
||||
* MXS-1896: LOAD DATA INFILE is mistaken for LOAD DATA LOCAL INFILE
|
||||
*
|
||||
* https://jira.mariadb.org/browse/MXS-1896
|
||||
*/
|
||||
|
||||
#include "testconnections.h"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
TestConnections test(argc, argv);
|
||||
|
||||
test.set_timeout(30);
|
||||
test.maxscales->connect();
|
||||
|
||||
test.try_query(test.maxscales->conn_rwsplit[0], "DROP TABLE IF EXISTS test.t1");
|
||||
test.try_query(test.maxscales->conn_rwsplit[0], "CREATE TABLE test.t1(id INT)");
|
||||
test.try_query(test.maxscales->conn_rwsplit[0], "INSERT INTO test.t1 VALUES (1), (2), (3)");
|
||||
test.try_query(test.maxscales->conn_rwsplit[0], "SELECT * FROM test.t1 INTO OUTFILE '/tmp/test.csv'");
|
||||
test.try_query(test.maxscales->conn_rwsplit[0], "LOAD DATA INFILE '/tmp/test.csv' INTO TABLE test.t1");
|
||||
test.try_query(test.maxscales->conn_rwsplit[0], "DROP TABLE test.t1");
|
||||
|
||||
test.maxscales->disconnect();
|
||||
|
||||
// Clean up the generated files
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
test.repl->ssh_node_f(i, true, "rm -f /tmp/test.csv");
|
||||
}
|
||||
|
||||
return test.global_result;
|
||||
}
|
||||
Reference in New Issue
Block a user