Page 1 of 1

SQL Error: Field 'CountryCodeId' doesn't have a default value

Posted: 23 Jan 2021, 12:01
by tintinux
Hi

This error is not a Gestinux bug, but a consequence of a change in recent versions of MySql and MariaDb.

It looks like that, with a default configuration, it is no more allowed to INSERT in a Table without listing all the fields, whenever the missing fields have a default value or can be NULL.

This is done in several places in Gestinux, and I'm not sure that this can be changed in next versions. IMHO this is a bug regarding to SQL standards.

It is possible to avoid this error with adding in the configuration file of the server :

Code: Select all

[server]
sql_mode = NO_ENGINE_SUBSTITUTION
The configuration files for Linux are in : /etc/mysql/mysql.cnf or mariadb.cnf
For Windows they are in : c:\windows\system
You must have admin rights to edit them, and restart the server after the changes.

Any suggestions or informations about this annoying problem are welcome !