[MYSQL 8] - [mysql error 3065] Expression #1 of ORDER BY clause is not in SELECT list #1369

Open
opened 2026-10-05 00:41:08 +02:00 by adam · 0 comments
Owner

Hello,

I'm migrating my piwigo from local mysql to a managed one on OVH public cloud

The backup and import is ok,
I'm able to login but when i try to go in one of my gallery, i get that error :

Warning:  [mysql error 3065] Expression #1 of ORDER BY clause is not in SELECT list, references column 'grim_piwigo.piwigo_images.date_available' which is not in SELECT list; this is incompatible with DISTINCT

SELECT DISTINCT(image_id)
  FROM piwigo_image_category
    INNER JOIN piwigo_images ON id = image_id
  WHERE
    category_id = 1

  ORDER BY date_available DESC, file ASC, id ASC
; in /config/www/gallery/include/dblayer/functions_mysqli.inc.php on line 847


Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /config/www/gallery/include/dblayer/functions_mysqli.inc.php:908 Stack trace: #0 /config/www/gallery/include/section_init.inc.php(317): query2array() #1 /config/www/gallery/index.php(12): include('/config/www/gal...') #2 {main} thrown in /config/www/gallery/include/dblayer/functions_mysqli.inc.php on line 908

Since it's a managed DB, i don't have full right on it so i can not disable some things like "sql mode" and the workaround here : https://github.com/Piwigo/Piwigo/blob/master/include/dblayer/functions_mysqli.inc.php#L62 is not working :(

( I'm on the latest piwigo version available ( update made the 17/11/2021 )

Thanks in advance !

Hello, I'm migrating my piwigo from local mysql to a managed one on OVH public cloud The backup and import is ok, I'm able to login but when i try to go in one of my gallery, i get that error : ``` Warning: [mysql error 3065] Expression #1 of ORDER BY clause is not in SELECT list, references column 'grim_piwigo.piwigo_images.date_available' which is not in SELECT list; this is incompatible with DISTINCT SELECT DISTINCT(image_id) FROM piwigo_image_category INNER JOIN piwigo_images ON id = image_id WHERE category_id = 1 ORDER BY date_available DESC, file ASC, id ASC ; in /config/www/gallery/include/dblayer/functions_mysqli.inc.php on line 847 Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /config/www/gallery/include/dblayer/functions_mysqli.inc.php:908 Stack trace: #0 /config/www/gallery/include/section_init.inc.php(317): query2array() #1 /config/www/gallery/index.php(12): include('/config/www/gal...') #2 {main} thrown in /config/www/gallery/include/dblayer/functions_mysqli.inc.php on line 908 ``` Since it's a managed DB, i don't have full right on it so i can not disable some things like "sql mode" and the workaround here : https://github.com/Piwigo/Piwigo/blob/master/include/dblayer/functions_mysqli.inc.php#L62 is not working :( ( I'm on the latest piwigo version available ( update made the 17/11/2021 ) Thanks in advance ! <!-- github-sync-id:1056685406 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1369