Skip to content

Conversation

@aashrayjain
Copy link

Background / Problem:
On Windows, importing OpenFlights data using load-data.sql can fail with:

ERROR 1406 (Data too long for column 'active')

This happens because Windows files use CRLF line endings (\r\n), while the original script uses LINES TERMINATED BY '\n'.
MariaDB reads the carriage return (\r) as part of the last column, causing data length errors for some short columns (like active in airlines).

Proposed Solution:

  • Added a new script sql/load-data-windows.sql specifically for Windows users.
  • Updated all LOAD DATA commands to use LINES TERMINATED BY '\r\n'.
  • Original load-data.sql remains unchanged for Linux/macOS users.
  • Updated README to include instructions for Windows users about the new script.

Recommendation / Request:

  • Windows users can run load-data-windows.sql to successfully import the data.
  • Maintainers may review and choose to merge, modify, or discard this PR as they see fit. This is intended as a suggestion to help Windows users and does not change the original workflow.

Added instructions for Windows users:

- Use `sql/load-data-windows.sql` instead of `sql/load-data.sql` on Windows
- Handles CRLF line endings to prevent errors like:
  ERROR 1406 (Data too long for column 'active')

Original Linux/macOS workflow remains unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant