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 upgrading to master version with MYSQL strict mode #3

Open
tsmr opened this issue Feb 2, 2016 · 3 comments
Open

Error upgrading to master version with MYSQL strict mode #3

tsmr opened this issue Feb 2, 2016 · 3 comments

Comments

@tsmr
Copy link

tsmr commented Feb 2, 2016

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
Copy link
Collaborator

orthagh commented Mar 25, 2016

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
Copy link
Collaborator

orthagh commented Mar 25, 2016

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 orthagh closed this as completed Mar 25, 2016
@orthagh orthagh reopened this Mar 25, 2016
@orthagh
Copy link
Collaborator

orthagh commented Mar 25, 2016

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

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

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

No branches or pull requests

2 participants