diff --git a/mysql-test/columnstore/basic/r/MCOL-5164-max-errors-and-report.result b/mysql-test/columnstore/basic/r/MCOL-5164-max-errors-and-report.result deleted file mode 100644 index 904096a42..000000000 --- a/mysql-test/columnstore/basic/r/MCOL-5164-max-errors-and-report.result +++ /dev/null @@ -1,51 +0,0 @@ -DROP DATABASE IF EXISTS mcol5164; -CREATE DATABASE mcol5164; -USE mcol5164; -CREATE TABLE t1(col1 INT, col2 VARCHAR(64)) ENGINE=Columnstore; -SELECT * FROM t1; -col1 col2 -Rejected rows: -0,test0,wrong -1,test1,wrong -2,test2,wrong -3,test3,wrong -4,test4,wrong -5,test5,wrong -6,test6,wrong -7,test7,wrong -8,test8,wrong -9,test9,wrong -10,test10,wrong -TRUNCATE t1; -SELECT * FROM t1; -col1 col2 -11 test11-good -Rejected rows: -0,test0,wrong -1,test1,wrong -2,test2,wrong -3,test3,wrong -4,test4,wrong -5,test5,wrong -6,test6,wrong -7,test7,wrong -8,test8,wrong -9,test9,wrong -10,test10,wrong -TRUNCATE t1; -SELECT * FROM t1; -col1 col2 -11 test11-good -Rejected rows: -0,test0,wrong -1,test1,wrong -2,test2,wrong -3,test3,wrong -4,test4,wrong -5,test5,wrong -6,test6,wrong -7,test7,wrong -8,test8,wrong -9,test9,wrong -10,test10,wrong -DROP DATABASE mcol5164; diff --git a/mysql-test/columnstore/basic/r/MCOL-5164-max-errors.result b/mysql-test/columnstore/basic/r/MCOL-5164-max-errors.result new file mode 100644 index 000000000..a3ef737aa --- /dev/null +++ b/mysql-test/columnstore/basic/r/MCOL-5164-max-errors.result @@ -0,0 +1,15 @@ +DROP DATABASE IF EXISTS mcol5164; +CREATE DATABASE mcol5164; +USE mcol5164; +CREATE TABLE t1(col1 INT, col2 VARCHAR(64)) ENGINE=Columnstore; +SELECT * FROM t1; +col1 col2 +TRUNCATE t1; +SELECT * FROM t1; +col1 col2 +11 test11-good +TRUNCATE t1; +SELECT * FROM t1; +col1 col2 +11 test11-good +DROP DATABASE mcol5164; diff --git a/mysql-test/columnstore/basic/r/MCOL-5164-report-bad.result b/mysql-test/columnstore/basic/r/MCOL-5164-report-bad.result new file mode 100644 index 000000000..78f9ecb2a --- /dev/null +++ b/mysql-test/columnstore/basic/r/MCOL-5164-report-bad.result @@ -0,0 +1,20 @@ +DROP DATABASE IF EXISTS mcol5164rep; +CREATE DATABASE mcol5164rep; +USE mcol5164rep; +CREATE TABLE t1(col1 INT, col2 VARCHAR(64)) ENGINE=Columnstore; +SELECT * FROM t1; +col1 col2 +11 test11-good +Rejected rows: +0,test0,wrong +1,test1,wrong +2,test2,wrong +3,test3,wrong +4,test4,wrong +5,test5,wrong +6,test6,wrong +7,test7,wrong +8,test8,wrong +9,test9,wrong +10,test10,wrong +DROP DATABASE mcol5164rep; diff --git a/mysql-test/columnstore/basic/t/MCOL-5164-max-errors-and-report.test b/mysql-test/columnstore/basic/t/MCOL-5164-max-errors.test similarity index 66% rename from mysql-test/columnstore/basic/t/MCOL-5164-max-errors-and-report.test rename to mysql-test/columnstore/basic/t/MCOL-5164-max-errors.test index 68c6cfe80..02601268d 100644 --- a/mysql-test/columnstore/basic/t/MCOL-5164-max-errors-and-report.test +++ b/mysql-test/columnstore/basic/t/MCOL-5164-max-errors.test @@ -2,7 +2,7 @@ if (!$MYSQL_TEST_ROOT){ skip Should be run by root to execute cpimport; } --- source ../include/have_columnstore.inc +--source ../include/have_columnstore.inc --disable_warnings DROP DATABASE IF EXISTS mcol5164; @@ -14,17 +14,13 @@ USE mcol5164; CREATE TABLE t1(col1 INT, col2 VARCHAR(64)) ENGINE=Columnstore; --exec mkdir -p /tmp/mtr-mcol5164 ---exec awk 'BEGIN { for (i = 0; i < 11; i++) { printf "%d,test%d,wrong\n", i, i; }; printf "%d,test%d-good", i, i; }' > /tmp/mtr-mcol5164/mcol5164.csv +--exec awk 'BEGIN { for (i = 0; i < 11; i++) { printf "%d,test%d,wrong\n", i, i; }; printf "%d,test%d-good\n", i, i; }' > /tmp/mtr-mcol5164/mcol5164.csv --disable_result_log --error 1 # exceeds default max-errors --exec $MCS_CPIMPORT -s , -L /tmp/mtr-mcol5164 mcol5164 t1 /tmp/mtr-mcol5164/mcol5164.csv --enable_result_log SELECT * FROM t1; ---exec echo Rejected rows: ---exec cat /tmp/mtr-mcol5164/mcol5164.csv*.bad ---exec rm -f /tmp/mtr-mcol5164/*.err ---exec rm -f /tmp/mtr-mcol5164/*.bad TRUNCATE t1; # implicitly set max-errors @@ -32,10 +28,6 @@ TRUNCATE t1; --exec $MCS_CPIMPORT -s , -e 11 -L /tmp/mtr-mcol5164 mcol5164 t1 /tmp/mtr-mcol5164/mcol5164.csv --enable_result_log SELECT * FROM t1; ---exec echo Rejected rows: ---exec cat /tmp/mtr-mcol5164/mcol5164.csv*.bad ---exec rm -f /tmp/mtr-mcol5164/*.err ---exec rm -f /tmp/mtr-mcol5164/*.bad TRUNCATE t1; # max-errors = all @@ -43,9 +35,6 @@ TRUNCATE t1; --exec $MCS_CPIMPORT -s , -e all -L /tmp/mtr-mcol5164 mcol5164 t1 /tmp/mtr-mcol5164/mcol5164.csv --enable_result_log SELECT * FROM t1; ---exec echo Rejected rows: ---exec cat /tmp/mtr-mcol5164/mcol5164.csv*.bad - # Clean UP --exec rm -rf /tmp/mtr-mcol5164 diff --git a/mysql-test/columnstore/basic/t/MCOL-5164-report-bad.test b/mysql-test/columnstore/basic/t/MCOL-5164-report-bad.test new file mode 100644 index 000000000..0b06c4a55 --- /dev/null +++ b/mysql-test/columnstore/basic/t/MCOL-5164-report-bad.test @@ -0,0 +1,35 @@ +if (!$MYSQL_TEST_ROOT){ + skip Should be run by root to execute cpimport; +} + +--source ../include/have_columnstore.inc +--source ../include/check_multinode.inc + +--if ($columnstore_nodes_count != 1) { + --skip This test makes sense when run on a single-node setup +--} + +--disable_warnings +DROP DATABASE IF EXISTS mcol5164rep; +--enable_warnings + +CREATE DATABASE mcol5164rep; +USE mcol5164rep; + +CREATE TABLE t1(col1 INT, col2 VARCHAR(64)) ENGINE=Columnstore; + +--exec mkdir -p /tmp/mtr-mcol5164rep +--exec awk 'BEGIN { for (i = 0; i < 11; i++) { printf "%d,test%d,wrong\n", i, i; }; printf "%d,test%d-good\n", i, i; }' > /tmp/mtr-mcol5164rep/mcol5164rep.csv + +--disable_result_log +--exec $MCS_CPIMPORT -e all -s , -L /tmp/mtr-mcol5164rep mcol5164rep t1 /tmp/mtr-mcol5164rep/mcol5164rep.csv +--enable_result_log +SELECT * FROM t1; +--exec echo Rejected rows: +--exec cat /tmp/mtr-mcol5164rep/mcol5164rep.csv*.bad +--exec rm -f /tmp/mtr-mcol5164rep/mcol5164rep.csv*.err +--exec rm -f /tmp/mtr-mcol5164rep/mcol5164rep.csv*.bad + +# Clean UP +--exec rm -rf /tmp/mtr-mcol5164rep +DROP DATABASE mcol5164rep; diff --git a/mysql-test/columnstore/include/check_multinode.inc b/mysql-test/columnstore/include/check_multinode.inc new file mode 100644 index 000000000..a1355900e --- /dev/null +++ b/mysql-test/columnstore/include/check_multinode.inc @@ -0,0 +1,4 @@ +--let CHECK_MULTINODE_RESULT=$MYSQL_TMP_DIR/check_multinode_result.inc +--exec echo "--let columnstore_nodes_count=`mcsGetConfig PrimitiveServers Count`" > $CHECK_MULTINODE_RESULT +--source $CHECK_MULTINODE_RESULT +--remove_file $CHECK_MULTINODE_RESULT