AOSSIE-Org / AOSSIE-Org/PictoPy

BUG: Dead/inconsistent PRAGMA case_sensitive_like in get_db_connection (affects no queries today, latent footgun)

オープン
#1,346 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
283
フォーク
679
平均マージ
7日 2時間
マージ済み PR(30日)
3

説明

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

`backend/app/database/connection.py:23` sets `PRAGMA case_sensitive_like = ON` inside `get_db_connection()`. But that helper is only used in ~4 call sites (all in `albums.py`), and the **only `LIKE` query in the codebase** - `db_get_folder_ids_by_path_prefix` (`backend/app/database/folders.py:344`, `WHERE folder_path LIKE ? || '%'`) — uses a **raw `sqlite3.connect()`** that never runs the pragma.

So today the pragma changes the behaviour of **zero** queries (dead config). It becomes a latent footgun the moment any `LIKE` query is migrated onto `get_db_connection()`: subfolder prefix matching would silently turn case-sensitive and miss subfolders on case-insensitive filesystems (macOS/Windows).

**Fix:** remove the pragma (LIKE is case-insensitive by default), or - if case-sensitive LIKE is actually intended - apply it consistently and migrate the folder-prefix query onto the shared helper.

### Record

- [x] I agree to follow this project's Code of Conduct

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。