I don't understand how this user http://piwigo.org/forum/viewtopic.php?id=27923 ended up in this situation but he had MySQL 5.7 and default datetime values at "0000-00-00 00:00:00". We should fix that with an upgrade script.
ALTER TABLE `piwigo_comments` CHANGE `date` `date` datetime NOT NULL default '1970-01-01 00:00:00';
ALTER TABLE `piwigo_history` CHANGE `date` `date` date NOT NULL default '1970-01-01';
ALTER TABLE `piwigo_images` CHANGE `date_available` `date_available` datetime NOT NULL default '1970-01-01 00:00:00';
ALTER TABLE `piwigo_old_permalinks` CHANGE `date_deleted` `date_deleted` datetime NOT NULL default '1970-01-01 00:00:00';
ALTER TABLE `piwigo_rate` CHANGE `date` `date` date NOT NULL default '1970-01-01';
ALTER TABLE `piwigo_sessions` CHANGE `expiration` `expiration` datetime NOT NULL default '1970-01-01 00:00:00';
ALTER TABLE `piwigo_upgrade` CHANGE `applied` `applied` datetime NOT NULL default '1970-01-01 00:00:00';
ALTER TABLE `piwigo_user_infos` CHANGE `registration_date` `registration_date` datetime NOT NULL default '1970-01-01 00:00:00';
I don't understand how this user http://piwigo.org/forum/viewtopic.php?id=27923 ended up in this situation but he had MySQL 5.7 and default datetime values at "0000-00-00 00:00:00". We should fix that with an upgrade script.
```
ALTER TABLE `piwigo_comments` CHANGE `date` `date` datetime NOT NULL default '1970-01-01 00:00:00';
ALTER TABLE `piwigo_history` CHANGE `date` `date` date NOT NULL default '1970-01-01';
ALTER TABLE `piwigo_images` CHANGE `date_available` `date_available` datetime NOT NULL default '1970-01-01 00:00:00';
ALTER TABLE `piwigo_old_permalinks` CHANGE `date_deleted` `date_deleted` datetime NOT NULL default '1970-01-01 00:00:00';
ALTER TABLE `piwigo_rate` CHANGE `date` `date` date NOT NULL default '1970-01-01';
ALTER TABLE `piwigo_sessions` CHANGE `expiration` `expiration` datetime NOT NULL default '1970-01-01 00:00:00';
ALTER TABLE `piwigo_upgrade` CHANGE `applied` `applied` datetime NOT NULL default '1970-01-01 00:00:00';
ALTER TABLE `piwigo_user_infos` CHANGE `registration_date` `registration_date` datetime NOT NULL default '1970-01-01 00:00:00';
```
<!-- github-sync-id:226258174 -->
I ended up with the same situation. I performed the SQL statements manually one by one after seeing each individual error on the top of the Admin pages in my browser when I run "Tools->Maintainance->Repair and optimise database".
I'm running Piwigo on this environment:
Piwigo 2.9.0
Operating system: Linux
PHP: 7.0.15-0ubuntu0.16.04.4 (Show info) [2017-05-05 00:02:46]
MySQL: 5.7.18-0ubuntu0.16.04.1 [2017-05-05 00:02:46]
Graphics Library: GD 2.1.1
Atleast I'm not the only one .... :-)
Kind regards
Jens
Hello,
I ended up with the same situation. I performed the SQL statements manually one by one after seeing each individual error on the top of the Admin pages in my browser when I run "Tools->Maintainance->Repair and optimise database".
I'm running Piwigo on this environment:
Piwigo 2.9.0
Operating system: Linux
PHP: 7.0.15-0ubuntu0.16.04.4 (Show info) [2017-05-05 00:02:46]
MySQL: 5.7.18-0ubuntu0.16.04.1 [2017-05-05 00:02:46]
Graphics Library: GD 2.1.1
Atleast I'm not the only one .... :-)
Kind regards
Jens
<!-- github-comment-id:299322006 -->
Hi, this also affects the update script "149-database.php" as it contains an incompatible ALTER statement - a dateime column cannot have the default NULL anymore ;-)
Hi, this also affects the update script ["149-database.php"](https://github.com/Piwigo/Piwigo/blob/master/install/db/149-database.php#L34) as it contains an incompatible ALTER statement - a dateime column cannot have the default NULL anymore ;-)
<!-- github-comment-id:305809556 -->
@plegall You're right, I might have had a incomplete understanding.
The issue is, when updating from ealier versions of MySQL where '0000-00-00' was a valid default for datetime, many databases run into trouble.
In fact, on updating Piwigo, I hat the issue taht the DB update script did not run through, the last_visit column was not added.
I found that this NULL default value caused the trouble but with you example that might not be the actual reason. I'll try to re-verify the cause.
@plegall You're right, I might have had a incomplete understanding.
The issue is, when updating from ealier versions of MySQL where '0000-00-00' was a valid default for datetime, many databases run into trouble.
In fact, on updating Piwigo, I hat the issue taht the DB update script did not run through, the last_visit column was not added.
I found that this NULL default value caused the trouble but with you example that might not be the actual reason. I'll try to re-verify the cause.
<!-- github-comment-id:307059945 -->
Warning: [mysql error 1292] Incorrect datetime value: '-0001-11-30 00:00:00' for column `piwigo`.`piwigo_images`.`date_creation` at row 1
UPDATE piwigo_images SET `filesize`='73168', `width`='1280', `height`='720', `date_creation`='-0001-11-30 00:00:00', `date_metadata_update`=CURDATE() WHERE `id`=12906; in /home/httpd/piwigo/include/dblayer/functions_mysqli.inc.php on line 845
For some reason the date_creation default value is NULL. Not sure where Piwigo is getting the crazy string from.
Would the SQL be better using CURDATE() for date_creation anyway ?
Similar on fedora 29 :
```
Warning: [mysql error 1292] Incorrect datetime value: '-0001-11-30 00:00:00' for column `piwigo`.`piwigo_images`.`date_creation` at row 1
UPDATE piwigo_images SET `filesize`='73168', `width`='1280', `height`='720', `date_creation`='-0001-11-30 00:00:00', `date_metadata_update`=CURDATE() WHERE `id`=12906; in /home/httpd/piwigo/include/dblayer/functions_mysqli.inc.php on line 845
```
For some reason the date_creation default value is NULL. Not sure where Piwigo is getting the crazy string from.
Would the SQL be better using CURDATE() for date_creation anyway ?
<!-- github-comment-id:469423068 -->
I have similar problem loading my site. And is not that invalid creation date.
Warning: array_merge(): Argument #1 is not an array in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/functions_user.inc.php on line 392
Warning: Invalid argument supplied for foreach() in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/functions_user.inc.php on line 394
Notice: Undefined index: id in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/functions_user.inc.php on line 420
Notice: Undefined index: status in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/functions_user.inc.php on line 420
Warning: [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 3
SELECT cat_id
FROM renzogro_user_access
WHERE user_id =
; in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/dblayer/functions_mysqli.inc.php on line 845
Fatal error: Call to a member function fetch_assoc() on boolean in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/dblayer/functions_mysqli.inc.php on line 906
I have similar problem loading my site. And is not that invalid creation date.
Warning: array_merge(): Argument #1 is not an array in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/functions_user.inc.php on line 392
Warning: Invalid argument supplied for foreach() in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/functions_user.inc.php on line 394
Notice: Undefined index: id in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/functions_user.inc.php on line 420
Notice: Undefined index: status in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/functions_user.inc.php on line 420
Warning: [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 3
SELECT cat_id
FROM renzogro_user_access
WHERE user_id =
; in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/dblayer/functions_mysqli.inc.php on line 845
Fatal error: Call to a member function fetch_assoc() on boolean in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/dblayer/functions_mysqli.inc.php on line 906
<!-- github-comment-id:509845355 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I don't understand how this user http://piwigo.org/forum/viewtopic.php?id=27923 ended up in this situation but he had MySQL 5.7 and default datetime values at "0000-00-00 00:00:00". We should fix that with an upgrade script.
Hello,
I ended up with the same situation. I performed the SQL statements manually one by one after seeing each individual error on the top of the Admin pages in my browser when I run "Tools->Maintainance->Repair and optimise database".
I'm running Piwigo on this environment:
Piwigo 2.9.0
Operating system: Linux
PHP: 7.0.15-0ubuntu0.16.04.4 (Show info) [2017-05-05 00:02:46]
MySQL: 5.7.18-0ubuntu0.16.04.1 [2017-05-05 00:02:46]
Graphics Library: GD 2.1.1
Atleast I'm not the only one .... :-)
Kind regards
Jens
Hi, this also affects the update script "149-database.php" as it contains an incompatible ALTER statement - a dateime column cannot have the default NULL anymore ;-)
@madmas are you really sure of that?
@plegall You're right, I might have had a incomplete understanding.
The issue is, when updating from ealier versions of MySQL where '0000-00-00' was a valid default for datetime, many databases run into trouble.
In fact, on updating Piwigo, I hat the issue taht the DB update script did not run through, the last_visit column was not added.
I found that this NULL default value caused the trouble but with you example that might not be the actual reason. I'll try to re-verify the cause.
When attempting a metadata synchronization in version 2.9.1, I got an error that I'm pretty sure is related to this issue:
My environment:
Similar on fedora 29 :
For some reason the date_creation default value is NULL. Not sure where Piwigo is getting the crazy string from.
Would the SQL be better using CURDATE() for date_creation anyway ?
I have similar problem loading my site. And is not that invalid creation date.
Warning: array_merge(): Argument #1 is not an array in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/functions_user.inc.php on line 392
Warning: Invalid argument supplied for foreach() in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/functions_user.inc.php on line 394
Notice: Undefined index: id in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/functions_user.inc.php on line 420
Notice: Undefined index: status in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/functions_user.inc.php on line 420
Warning: [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 3
SELECT cat_id
FROM renzogro_user_access
WHERE user_id =
; in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/dblayer/functions_mysqli.inc.php on line 845
Fatal error: Call to a member function fetch_assoc() on boolean in /var/www/vhosts/renzogrosso.com/public_html/galeria/include/dblayer/functions_mysqli.inc.php on line 906