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

ERROR 1406 (22001) at line 313: Data too long for column 'COLUMN NAME' at row 412 #391

Open
pereorga opened this issue Jul 8, 2022 · 1 comment
Labels

Comments

@pereorga
Copy link

pereorga commented Jul 8, 2022

Source: MS Access (ACE12)
Target: MySQL (tested on MariaDB 10.5-10.8)

Before upgrading to Ubuntu 22.04 (from Ubuntu 20.04, mdbtools 0.7.1), I had noticed the varchar length of the fields exported by mdb-schema were double the length of what it was set in MS Access. This got "fixed" in the mdbtools version included in Ubuntu 22.04 (v1.0.0).

However, this change of behavior broke our import process for a few columns:

ERROR 1406 (22001) at line 313: Data too long for column 'MODISME' at row 412.

The commands used are standard:

mdb-schema --no-indexes --no-relations -T 00_PAREMIOTIPUS ../database.accdb mysql
mdb-export -I mysql -D '%Y-%m-%d %H:%M:%S' ../database.accdb "00_PAREMIOTIPUS"

I imagine this had to do with special characters or encoding issues. I temporarily "fixed" it with:

sed -i 's/varchar (255)/varchar (512)/g' ../install/db/db.sql

Does anyone know if something changed between mdbtools v1.0.0 and 0.7.1 that could have caused this issue? (or in libmdb2 / libmdbsql libraries)

We are using mdbtools in a non-profit website made by volunteers (https://pccd.dites.cat/). I am happy to share the MS Access file privately if useful (it is the biggest online repository of Catalan sayings and proverbs, so it is quite big).

@evanmiller evanmiller added the CLI label Dec 17, 2022
@pereorga
Copy link
Author

pereorga commented Dec 21, 2022

I just noticed that this data length error is not happening if I do not normalize the data with uconv. This is the uconv command I'm running:

uconv -x nfkc mdbtools_generated_file.sql > file_to_import.sql

So I think this may be related to my setup, or even a non-issue (expected behaviour). Sorry for the noise, I somehow forgot that I was running uconv here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants