[MCOL-1860] cannot insert symbols in column using the mcsimport with escape_character option Created: 2018-11-06  Updated: 2023-10-26  Resolved: 2018-11-09

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 1.2.1
Fix Version/s: 1.2.1

Type: Task Priority: Major
Reporter: Zdravelina Sokolovska (Inactive) Assignee: Zdravelina Sokolovska (Inactive)
Resolution: Fixed Votes: 0
Labels: None


 Description   

cannot insert symbols in column using the mcsimport with escape_character option

how to repeat
import column value b"bbb or b\bb\ using escape_character '"' or \''
the value including " or \ character is not inserted although using mcsimport with escape_character option
A. file content :

"aaa","b""bbb","c\cc"

 ./mcsimport a c c.csv -E '"' -C '"'
Execution time: 0.0988391s
Rows inserted: 1
Truncation count: 3
Saturated count: 0
Invalid count: 0

MariaDB [(none)]> select * from a.c ;
+------+------+------+
| c    | d    | e    |
+------+------+------+
| a    | b    | c    |
+------+------+------+
1 row in set (0.056 sec)

B.file content:

"aaa","b\"bb","ccc"
"aaa","b\\bb\\","c\cc"

./mcsimport a c c.csv -E '"' -C '\'
Execution time: 0.0930145s
Rows inserted: 2
Truncation count: 6
Saturated count: 0
Invalid count: 0

MariaDB [(none)]> select * from a.c ;
+------+------+------+
| c    | d    | e    |
+------+------+------+
| a    | b    | c    |
| a    | b    | c    |
+------+------+------+
2 rows in set (0.040 sec)



 Comments   
Comment by Zdravelina Sokolovska (Inactive) [ 2018-11-09 ]

[root@cps mcsimport]# cat ff
"aaa","b""bbb","ccc"

[root@cps mcsimport]# ./mcsimport a f f.csv -E '"' -C '"'
Execution time: 0.143883s
Rows inserted: 1
Truncation count: 0
Saturated count: 0
Invalid count: 0

[root@cps mcsimport]# ./mcsimport a f f.csv -E '"' -C '\'

Execution time: 0.141875s
Rows inserted: 1
Truncation count: 0
Saturated count: 0
Invalid count: 0

[root@cps mcsimport]# cat f.csv
"a","b\"bb","ccc"

[root@cps mcsimport]# mcsmysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 32
Server version: 10.3.10-MariaDB-log Columnstore 1.2.1-1

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> select * from a.f ;
---------------

a b c

---------------

aaa b"bbb ccc
a b"bb ccc

[root@cps mcsimport]# cat f.csv
"aaa","b\\bb\\","c\cc"

[root@cps mcsimport]# ./mcsimport a f f.csv -E '"' -C '\'
Execution time: 0.155146s
Rows inserted: 1
Truncation count: 0
Saturated count: 0
Invalid count: 0
[root@cps mcsimport]# mcsmysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 34
Server version: 10.3.10-MariaDB-log Columnstore 1.2.1-1

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> select * from a.f ;
---------------

a b c

---------------

aaa b"bbb ccc
a b"bb ccc
aaa b\bb\ c\cc

---------------
3 rows in set, 1 warning (0.059 sec)

Generated at Thu Feb 08 02:31:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.