Advanced search  


CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Modify Albums settings - does not Work (HORROR SQL statement in code?)  (Read 4579 times)

0 Members and 1 Guest are viewing this topic.


  • Coppermine newbie
  • Offline Offline
  • Posts: 6

My installation (30.000 Users, 30.000 Pics) crashes almost when trying to modify settings of Albums. If I look in mysql -> Processlist I get Millions of queries LOCKED because of something starting with:

| 290 | admin | localhost | comicfandb | Query   | 76   | Copying to tmp table | SELECT aid, IF(username IS NOT NULL, CONCAT('(', username, ') ', title), CONCAT(' - ', title)) AS ti |

All other queries behind this one are locked, I think this one makes a query to cpg_pictures and nuke_users at the same time. Please HELP!


  • Coppermine newbie
  • Offline Offline
  • Posts: 6

I found this one in modifyalb.php:

$sql = "SELECT aid, IF($field_user_name IS NOT NULL, CONCAT('(', $field_user_name, ') ', title), CONCAT(' - ', title)) AS title " . "FROM {$CONFIG['TABLE_ALBUMS']} AS a " . "LEFT JOIN {$CONFIG['TABLE_USERS']} AS u ON category = (" . FIRST_USER_CAT . " + $field_user_id) " . "ORDER BY title";

this seems to be a killer query. Joining two tables without using indexes in the JOIN field and ordering without index. It is running minutes and the worst:

It locks all other queries to the cpg_albums and nuke_users table....

Is there any other way????


  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231

This code does not appear in coppermine 1.3.0 standalone, and as you seem to be running a nuke site, I suspect you have the nuke version of coppermine(at least you should have).
For coppermine for CMS support you should go to
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here
Pages: [1]   Go Up

Page created in 0.016 seconds with 19 queries.