Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datastore MySQL Import handles empty file incorrect #4273

Closed
stefan-korn opened this issue Sep 4, 2024 · 0 comments · Fixed by #4293
Closed

Datastore MySQL Import handles empty file incorrect #4273

stefan-korn opened this issue Sep 4, 2024 · 0 comments · Fixed by #4293
Labels

Comments

@stefan-korn
Copy link
Contributor

stefan-korn commented Sep 4, 2024

Current Behavior

The Datastore MySQL import submodule handles an empty file incorrect (differently than the import via CSV parser) resulting in an error during execution of the import:
ValueError: fread(): Argument #2 ($length) must be greater than 0 in fread()

This will lead to termination of the import job, while compared with the import via CSV parser (without Datastore MySQL import module) the import job will continue and just mark the empty file with an error in the import status.

Expected Behavior

Datastore MySQL import should show the same behavior on import of an empty file as the import via CSV parser (mark the file as an error in import status, but not terminate the whole import job).

Steps To Reproduce

  • Upload an empty CSV file to a distribution
  • Start the import to the datastore (via cron)
  • Note the error message starting with "Error importing resource id ..."

Compare this to:

  • Upload an empty CSV file to a distribution
  • enable the datastore_mysql_import submodule
  • Start the import to the datastore (via cron)
  • Note the different error message and note that cron execution is terminated

Relevant log output (optional)

No response

Anything else?

No response

@stefan-korn stefan-korn added the bug label Sep 4, 2024
janette pushed a commit that referenced this issue Sep 18, 2024
…st) (#4293)

* #4273: Datastore MySQL Import handles empty file incorrect
* Added a test for empty CSV.

Co-authored-by: Stefan Korn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant