Announcement

#1 2021-12-03 22:03:10

triggerhappy
Member
2021-11-30
5

MySQL error when searching for shot:YYYY-MM

Hello

When I search by year in Batch Manager, things go well.
I started narrowing the results by month using shot:YYYY-M or YYYY-MM and I start seeing this:

Warning:  [mysql error 1525] Incorrect DATETIME value: '2015-2-31 23:59:59'
SELECT id from piwigo_images i WHERE
((date_creation >= '2015-2-1' AND date_creation <= '2015-2-31 23:59:59')) in /var/www/html/galeria/include/dblayer/functions_mysqli.inc.php on line 847

Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /var/www/html/galeria/include/dblayer/functions_mysqli.inc.php:908 Stack trace: #0 /var/www/html/galeria/include/functions_search.inc.php(1043): query2array() #1 /var/www/html/galeria/include/functions_search.inc.php(1411): qsearch_get_images() #2 /var/www/html/galeria/admin/batch_manager.php(595): get_quick_search_results_no_cache() #3 /var/www/html/galeria/admin.php(314): include('/var/www/html/g...') #4 {main} thrown in /var/www/html/galeria/include/dblayer/functions_mysqli.inc.php on line 908

Piwigo 12.1.0
    Operating system: Linux
    PHP: 7.4.3 (Show info) [2021-12-03 14:57:20]
    MySQL: 8.0.27-0ubuntu0.20.04.1 [2021-12-03 14:57:20]
    Graphics Library: External ImageMagick 6.9.10-23
    Cache size 312.94 Mo   calculated 5 hours ago

    Language Switch
    Presync AutoRename
    SmartAlbums
    Take A Tour of Your Piwigo

Offline

 

#2 2021-12-04 00:48:48

Zentalquabula
Member
2014-05-10
208

Re: MySQL error when searching for shot:YYYY-MM

Try editing my.cnf:

sql-mode=''

Offline

 

#3 2021-12-06 07:24:06

triggerhappy
Member
2021-11-30
5

Re: MySQL error when searching for shot:YYYY-MM

I'm sorry -- I did not understand your answer until discovering that my.cnf is a part of MySQL configuration, which I'm not familiar with. This server was installed on bare metal completely from scratch, and practically with default options for LAMP.

I added a configuration file under /etc/mysql/mysql.conf.d/ on my Ubuntu server as instructed by ./mysql/mysql.cnf then restarted using #service mysql restart. I used the option you're proposing.

It did NOT remove the error that crashes Piwigo Batch Editor.

What's weird is that not all months in the taken:YYYY-M format cause the error. For example, YYYY-1, YYYY-3, YYYY-5, YYYY-7 return valid photos, but YYYY-2, YYYY-4, YYYY-6, YYYY-8, YYYY-9 (yes, that's an odd number) and above cause a crash.

EDIT: After posting this, I discovered that I can just search for "February 2020" to get relevant results, instead of taken:YYYY-2

Thanks!

Last edited by triggerhappy (2021-12-06 07:37:57)

Offline

 

#4 2021-12-06 18:25:14

triggerhappy
Member
2021-11-30
5

Re: MySQL error when searching for shot:YYYY-MM

Hi,
Thanks for the reply, unfortunately my understanding of db config or queries is so poor that I can't even tell if you're talking about improving the DB query in the PHP code, or is this some type of mysql config instruction.

Sorry, I'm not a sysadmin or db admin, just an end user reporting an error back to the devs, if that makes sense.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact