mirror of
https://github.com/photoprism/photoprism.git
synced 2026-03-02 22:57:18 -05:00
Query breaks in strict compilers, or Mariadb in only_full_group_by mode #1713
Labels
No labels
ai
android
api
auth
awesome
bug
bug
ci
cli
config
database
declined
deprecated
docker
docs 📚
documents
duplicate
easy
enhancement
enhancement
enhancement
epic
faces
feedback wanted
frontend
hacktoberfest
help wanted
idea
in-progress
incomplete
index
invalid
ios
labels
live
live
low-priority
macos
member-feature
metadata
mobile
nas
needs-analysis
no-coding-required
no-coding-required
observability
performance
places
please-test
plus-feature
priority
pro-feature
question
raspberry-pi
raw
released
released
released
research
resolved
security
sharing
tested
tests
third-party-issue
thumbnails
upgrade
upstream-issue
ux
vector
video
waiting
won't fix
won't fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/photoprism#1713
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dankasak on GitHub (Feb 20, 2023).
1. What is not working as documented?
Databases that are stricter than old MySQL / Mariadb throw an error on the query generated from:
https://github.com/dankasak/photoprism/blob/develop/internal/config/client_config.go#L613
2. How can we reproduce it?
Install into a MySQL compatible database in only_full_group_by mode and look at error log
Steps to reproduce the behavior:
Install into a MySQL compatible database in only_full_group_by mode and look at error log. Eg in TiDB:
[2023/02/15 21:42:01.175 +11:00] [WARN] [session.go:2188] ["compile SQL failed"] [conn=3747630407693107665] [error="[planner:1055]Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'photoprism.l.label_uid' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by"] [SQL="SELECT l.label_uid, l.custom_slug, l.label_name FROM
categoriesJOIN labels l ON categories.category_id = l.id WHERE (l.deleted_at IS NULL) GROUP BY l.custom_slug ORDER BY l.custom_slug LIMIT 1000 OFFSET 0"]3. What behavior do you expect?
No SQL error
4. What could be the cause of your problem?
SELECT l.label_uid, l.custom_slug, l.label_name FROM
categoriesJOIN labels l ON categories.category_id = l.id WHERE (l.deleted_at IS NULL) GROUP BY l.custom_slug ORDER BY l.custom_slug LIMIT 1000 OFFSET 0... should be:
SELECT l.label_uid, l.custom_slug, l.label_name FROM
categoriesJOIN labels l ON categories.category_id = l.id WHERE (l.deleted_at IS NULL) GROUP BY l.custom_slug, l.label_uid, l.label_name ORDER BY l.custom_slug LIMIT 1000 OFFSET 05. Can you provide us with example files for testing, error logs, or screenshots?
NA
6. Which software versions do you use?
(a) PhotoPrism Architecture: AMD64, Build Number: docker pull from today
(b) Database Type & Version: TiDB
(c) Operating System Types & Versions: Linux
(d) Browser Types & Versions: Firefox
(e) Ad Blockers, Browser Plugins, and/or Firewall Software? NA
7. On what kind of device is PhotoPrism installed?
(a) Device / Processor Type: Ryzen 5 7600X
(b) Physical Memory & Swap Space in GB. RAM: 32GB, Swap: 8GB
(c) Storage Type: HDD, SSD, RAID, USB, Network Storage,... 2x2TB SSDs in RAID1
(d) Anything else that might be helpful to know? No
8. Do you use a Reverse Proxy, Firewall, VPN, or CDN? No
@qdii commented on GitHub (Oct 14, 2025):
Can we get this merged? this is still broken