Now I know that I found the reason for the backup error (Features)

by Auge ⌂ @, Tuesday, September 22, 2020, 21:24 (28 days ago) @ shian


… I tried to restore again using my little forum 'Restore', and I got a new error![/i] :-D :


MySQL error: Column count doesn't match value count at row 1

This is definitely the entries table (as I assumed). There was the column email_notification up to the version 2.4.13. With the new structure to store subscriptions, introduced with 2.4.14 the column got removed but it still existed in the backup script. It is there only in the INSERT-statements for the restore that does not contain a column list. Default behaviour of MySQL in this case is to try to distribute the given data to all of the columns but the number of provided data columns in the INSERT-statement does not fit with the real number of table columns (valid for version installed before 2.4.14 and updated to version 2.4.14 or higher).

Additionally I found the column email_notification in the installation script. If the forum was installed with a newer version than 2.4.13 the column was created but never used. If one created a backup and restored it, the number of columns in the statements and in the table matched. With a version that was installed before 2.4.14 and where the update script removed the column with the update to 2.4.14 the number of columns does not match in case of restoring a backup.

I reworked the whole backup script.

- The statement strings that will be created by the script will from now on contain a field/column list in every statement. With that one can compare the number of table columns with the number of data fields if one can read SQL-code.
- I added backup functions for subscriptions and for tags.
- I corrected the statement for the entries and removed the column email_notification in the end.
- I put a bit of work into the determination of the file sizes of the backup files after seeing file sizes of 0.000MB for files with under 1 Kilobyte of data.

I will release a new version (2.4.22) within the next two days (until thursday evening (CEST)).

Tschö, Auge

Trenne niemals Müll, denn er hat nur eine Silbe!

Complete thread:

 RSS Feed of thread

powered by my little forum