[MCOL-1226] cpimport fills last date column with '0000-00-00 00:00:00' instead of null Created: 2018-02-21 Updated: 2018-05-18 Resolved: 2018-05-18 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | cpimport |
| Affects Version/s: | 1.1.2 |
| Fix Version/s: | Icebox |
| Type: | Bug | Priority: | Major |
| Reporter: | Dalu (Inactive) | Assignee: | Andrew Hutchings (Inactive) |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Debian 9 / Ubuntu 16 |
||
| Description |
|
When importing a csv file via cpimport and the last column is a date column containing no/null values in the csv file, cpimport writes '0000-00-00 00:00:00' into that fields instead of null/nothing |
| Comments |
| Comment by Andrew Hutchings (Inactive) [ 2018-02-21 ] | ||||||||||||||||
|
If I am understanding correctly you have a CSV file with NULL values in a DATETIME column and are saying that it writes out '0000-00-00 00:00:00'. If this is the case can you please try using the option '-n1' with cpimport? This tells it that NULL is the value NULL not the word NULL. | ||||||||||||||||
| Comment by Dalu (Inactive) [ 2018-02-21 ] | ||||||||||||||||
|
Example: CREATE TABLE `testtable` (, I import a csv file via cpimport: and cpimport writes into table: as I said this happens only to/if the last column of the table is a date/datetime column. CREATE TABLE `testtable` (, With this scenario everything works correctly, since Date3 is not the last column of the table. | ||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2018-02-21 ] | ||||||||||||||||
|
With a file containing 3 empty columns I get:
Can you please let us know what cpimport options you are using? | ||||||||||||||||
| Comment by Dalu (Inactive) [ 2018-02-21 ] | ||||||||||||||||
|
okay I missed one point, one of the entries need to have a none null value for the last column. try the following csv: ,, the last column of the first entry will get filled with 0000-00-00 00:00:00
my cpimport options are | ||||||||||||||||
| Comment by Dalu (Inactive) [ 2018-03-13 ] | ||||||||||||||||
|
Was it possible to reproduce this behavior? | ||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2018-03-13 ] | ||||||||||||||||
|
Unfortunately not, here is what I am doing, please let me know where I'm going wrong: Table:
CSV file (tab delimited CSV data):
cpimport command:
Resulting database data:
| ||||||||||||||||
| Comment by Dalu (Inactive) [ 2018-05-18 ] | ||||||||||||||||
|
with current version this behavior didnt happen anymore - issue can be closed | ||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2018-05-18 ] | ||||||||||||||||
|
Closing upon request |