1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

feature(cpimport): MCOL-5164 ignore all errors (-e all)

This commit is contained in:
Aleksei Antipovskii
2025-06-20 17:20:40 +02:00
committed by Leonid Fedorov
parent 7dca1da8f2
commit 1ce46b5e0b
15 changed files with 209 additions and 56 deletions

View File

@ -0,0 +1,51 @@
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;

View File

@ -0,0 +1,52 @@
if (!$MYSQL_TEST_ROOT){
skip Should be run by root to execute cpimport;
}
-- source ../include/have_columnstore.inc
--disable_warnings
DROP DATABASE IF EXISTS mcol5164;
--enable_warnings
CREATE DATABASE mcol5164;
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
--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
--disable_result_log
--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
--disable_result_log
--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
DROP DATABASE mcol5164;