Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
1.2.0
-
2018-20
Description
I noticed that the cpimport utility currently does not handle "true" keyword. Inserting rows into a table with numeric columns assigned "true" values via the mariadb client works fine, but cpimport is converting these to 0 when imported via a text file.
Here is an example:
MariaDB [mcs]> create table t7 (a boolean, b tinyint, c smallint, d int, e bigint, f float, g double, h decimal(10, 3))engine=columnstore; |
Query OK, 0 rows affected (0.241 sec) |
|
MariaDB [mcs]> insert into t7 values (false, false, false, false, false, false, false, false), (true, true, true, true, true, true, true, true); |
Query OK, 2 rows affected (0.281 sec) |
Records: 2 Duplicates: 0 Warnings: 0
|
|
MariaDB [mcs]> select * from t7; |
+------+------+------+------+------+------+------+-------+ |
| a | b | c | d | e | f | g | h |
|
+------+------+------+------+------+------+------+-------+ |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000 |
|
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1.000 |
|
+------+------+------+------+------+------+------+-------+ |
2 rows in set (0.143 sec) |
Now inserting 2 records from a text file into this table using cpimport:
tntnatbry:bin$ cat data.txt |
false|false|false|false|false|false|false|false |
true|true|true|true|true|true|true|true |
|
tntnatbry:bin$ sudo ./cpimport.bin mcs t7 ./data.txt |
The new contents of the table:
MariaDB [mcs]> select * from t7; |
+------+------+------+------+------+------+------+-------+ |
| a | b | c | d | e | f | g | h |
|
+------+------+------+------+------+------+------+-------+ |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000 |
|
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1.000 |
|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000 |
|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000 |
|
+------+------+------+------+------+------+------+-------+ |
4 rows in set (0.096 sec) |
I am assuming this is not intended behaviour.
Attachments
Issue Links
- relates to
-
MCOL-1879 csv text "true" is mapped to 0 during import but should be parsed to 1
- Closed