administration page failed loading when piwigo is installad without any table prefix #872

Closed
opened 2026-10-05 00:22:08 +02:00 by adam · 7 comments
Owner

Versions
Release : head of master branch
MySQL: 8.0.11
PHP: 7.2.4

Step to reproduce
1 Install piwigo on a newly created database without any prefix for table name
2 Add a picture
3 With menu on left got to administration page

Results
:heavy_check_mark:Step 1: OK
:heavy_check_mark:Step 2: OK
:x:Step 3: KO. Following error message appeared in the browser

Piwigo a rencontré une erreur non récupérable
[mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups' at line 2

SELECT COUNT(*)
FROM groups
;

#1 my_error D:\www_root\piwigo_src\include\dblayer\functions_mysqli.inc.php(147)
#2 pwg_query D:\www_root\piwigo_src\admin\intro.php(190)
#3 include D:\www_root\piwigo_src\admin.php(324)

**Versions** Release : head of master branch MySQL: 8.0.11 PHP: 7.2.4 **Step to reproduce** 1 Install piwigo on a newly created database without any prefix for table name 2 Add a picture 3 With menu on left got to administration page **Results** :heavy_check_mark:Step 1: OK :heavy_check_mark:Step 2: OK :x:Step 3: KO. Following error message appeared in the browser Piwigo a rencontré une erreur non récupérable [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups' at line 2 SELECT COUNT(*) FROM groups ; #1 my_error D:\www_root\piwigo_src\include\dblayer\functions_mysqli.inc.php(147) #2 pwg_query D:\www_root\piwigo_src\admin\intro.php(190) #3 include D:\www_root\piwigo_src\admin.php(324) <!-- github-sync-id:427411893 -->
adam closed this issue 2026-10-05 00:22:08 +02:00
Author
Owner

OK, so "groups" is now a reserved keyword in MySQL 8 :-/ gonna have to escape it with backtits!

OK, so "groups" is now a reserved keyword in MySQL 8 :-/ gonna have to escape it with backtits! <!-- github-comment-id:478917983 -->
Author
Owner

PR #922 is related (for the rank keyword).

PR #922 is related (for the `rank` keyword). <!-- github-comment-id:478925517 -->
Author
Owner

@samwilson @pstimpel my opinion right now, is that Piwigo needs to escape column names with backtits everywhere, which has less "risky" impact than renaming all problematic columns.

Considering MySQL 8 is not yet very common, I think we can plan this important change for Piwigo 2.10 and not for 2.9. Do you both agree with that?

@samwilson @pstimpel my opinion right now, is that Piwigo needs to escape column names with backtits everywhere, which has less "risky" impact than renaming all problematic columns. Considering MySQL 8 is not yet very common, I think we can plan this important change for Piwigo 2.10 and not for 2.9. Do you both agree with that? <!-- github-comment-id:479804890 -->
Author
Owner

Yep most definitely. :-)

I don't even really think there's much wrong with having column names the same as keywords. Better to not to, certainly, but no need to be a high priority to fix.

(And by the way, it's backticks, with a ck...)

Yep most definitely. :-) I don't even really think there's much wrong with having column names the same as keywords. Better to not to, certainly, but no need to be a high priority to fix. (And by the way, it's `backticks`, with a `ck`...) <!-- github-comment-id:479827353 -->
Author
Owner

I agree with the backticks, and with your timeline as well. Keep in mind we do not know about Oracles plans for Mysql. Maybe you will create kind of a sleeping nightmare. But yes, for th moment this should be OK

I agree with the backticks, and with your timeline as well. Keep in mind we do not know about Oracles plans for Mysql. Maybe you will create kind of a sleeping nightmare. But yes, for th moment this should be OK <!-- github-comment-id:479846882 -->
Author
Owner

(And by the way, it's backticks, with a ck...)

LOL, I don't want to know what "backtit" might mean ;-) thank you for telling me it's backtick :-D

> (And by the way, it's `backticks`, with a `ck`...) LOL, I don't want to know what "backtit" might mean ;-) thank you for telling me it's backtick :-D <!-- github-comment-id:479895313 -->
Author
Owner

@samwilson @pstimpel my opinion right now, is that Piwigo needs to escape column names with backtits everywhere, which has less "risky" impact than renaming all problematic columns.

Considering MySQL 8 is not yet very common, I think we can plan this important change for Piwigo 2.10 and not for 2.9. Do you both agree with that?

Yes sure.
It's important to plan it for easier troubleshooting and maintenance.

> @samwilson @pstimpel my opinion right now, is that Piwigo needs to escape column names with backtits everywhere, which has less "risky" impact than renaming all problematic columns. > > Considering MySQL 8 is not yet very common, I think we can plan this important change for Piwigo 2.10 and not for 2.9. Do you both agree with that? Yes sure. It's important to plan it for easier troubleshooting and maintenance. <!-- github-comment-id:484391032 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#872