dkan icon indicating copy to clipboard operation
dkan copied to clipboard

MySQL Datastore Importer doesn't know how to handle CSV files with empty column headers

Open clayliddell opened this issue 3 years ago • 0 comments

Describe the bug

If a CSV file with an empty column header is provided for a dataset, the following error will occur on import:

[error]  Import for 7f1142b510169890cf53d6685fcc5e16__1629317226 returned an error: SQLSTATE[42000]: Syntax error or access violation: 1166 Incorrect column name '': CREATE TABLE @datastore_dbdcdbe7dbfe10d6de3784bb24db0f88 (
`record_number` INT unsigned NOT NULL auto_increment, 
`lorem_ipsum_dolor_sit_amet_consectetur_adipiscing_elit_sed__1f7b` TEXT DEFAULT NULL, 
`` TEXT DEFAULT NULL, 
PRIMARY KEY (`record_number`)
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4; Array
(
)

Steps To Reproduce

  1. Upload a dataset CSV file with an empty column header.
  2. Attempt to import the dataset.
  3. Observe the above error.

Expected behavior

The dataset should be imported without issue.

clayliddell avatar Aug 18 '21 20:08 clayliddell