OBDUMPER exports empty date values

Applies to: V2.1.x,V2.2.x,V3.0.x,V3.1.x,V3.2.x,V3.3.x,V4.0.x,V4.1.x,V4.2.x,V4.3.x

Applicable versions

All versions of the data import and export tools.

Problem description

Table data exported with OBDUMPER cannot be imported again:

  1. Create test and insert data.

    obdumper-1

  2. Export the data with OBDUMPER.

    obdumper-2

  3. Inspect the exported data. The birthday field is empty.

    obdumper-3

  4. Create test2 with the same schema.

    obdumper-4

  5. Import the data with OBLOADER.

    obdumper-5

  6. The import fails.

    obdumper-6

  7. The error log shows that a null value cannot be inserted into a non-nullable column.

    obdumper-7

    obdumper-8

Cause

The date value in test is 0000-00-00 00:00:00, which is not a valid date. Export therefore converts it to null by default.

Solution

Use a control file to resolve the issue.

  1. Define the following control file to fill an empty value in this column with '0000-00-00 00:00:00'.

    obdumper-9

  2. Specify the control file during import. For details, see Define a control file.

    obdumper-10