Silent records-import error when the number of columns/fields is big
If you try to import a CSV with a lot of columns/fields (regardless of the number of rows/records) to a module that also has many fields you might run into this problem.
After doing the field mapping step, you get a summary telling you that 0/0 records were created:
That happens because, as part of the import process, a temporary table is created where the records are stored with a name like vtiger_import_1
When there are too many fields, the table cannot be created because of this error:
ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535.
This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
In my case, the error was issued by MariaDB 10.5
.
The table creation is attempted in Import_FileReader_Reader::createTable()
, which looks like this:
the function blindly returns true
regardless of the result of the query.
To fix this, I think there should be some error handling that checks for errors in the query. If the query fails, then display a "Database Error" to the end user, instead of saying that 0 out of 0 records were imported.