TECLIB / fusioninventory-for-glpi

Teclib' version of FusionInventory For GLPI plugin
http://www.FusionInventory.org/
GNU Affero General Public License v3.0
6 stars 5 forks source link

Error upgrading to master version with MYSQL strict mode #3

Open tsmr opened 8 years ago

tsmr commented 8 years ago
2016-02-02 09:14:13 [6@P365]
  *** MySQL query error:
  SQL: ALTER TABLE `glpi_plugin_fusioninventory_networkportconnectionlogs` CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT  ,
CHANGE `date_mod` `date_mod` datetime NOT NULL DEFAULT \'0000-00-00 00:00:00\'  ,
CHANGE `creation` `creation` tinyint(1) NOT NULL DEFAULT \'0\'  ,
CHANGE `networkports_id_source` `networkports_id_source` int(11) NOT NULL DEFAULT \'0\'  ,
CHANGE `networkports_id_destination` `networkports_id_destination` int(11) NOT NULL DEFAULT \'0\'  ,
CHANGE `plugin_fusioninventory_agentprocesses_id` `plugin_fusioninventory_agentprocesses_id` int(11) NOT NULL DEFAULT \'0\'  
  Error: Valeur par défaut invalide pour 'date_mod'
  Backtrace :
  inc\dbmysql.class.php:205                          
  inc\migration.class.php:579                        DBmysql->queryOrDie()
  plugins\fusioninventory\install\update.php:2389    Migration->migrationOneTable()
  plugins\fusioninventory\hook.php:978               pluginFusioninventoryUpdate()
  inc\plugin.class.php:643                           plugin_fusioninventory_install()
  front\plugin.form.php:49                           Plugin->install()

No problem if i remove strict mode

orthagh commented 8 years ago

See http://stackoverflow.com/questions/25349126/how-can-i-set-the-default-value-of-a-field-as-0000-00-00-000000

We need to set default value to datetime to 1000-01-01 00:00:00, i think.

orthagh commented 8 years ago

There is a lot of theses 0000-00-00 00:00:00 also in install. Do you have this kind of error on empty installation of the plugin ?

orthagh commented 8 years ago

Finally, i can't replicate with SET sql_mode = 'STRICT_TRANS_TABLES';

How do you disable/enable strict mode on your server ?