Closed kaeni1Ohkohd closed 1 year ago
That's interesting. I found this report from the Gallery website a long time ago - does the name of the item or album have any accented characters?
No, no "fancy" characters at all. Both the album name (testalbum) and the item name (DSC_3149.jpg) will fit into US7ASCII.
To verify my suspicion that the issue is caused by the ancient adodb (version V4.98 13 Feb 2008) included in Gallery2 I replaced that adodb version in gallery2/lib/adodb with the latest (v5.22.4 2022-10-28) and that solves the issue when using PostgreSQL as database. The catch is that it breaks at least the imageblock module due to a stricter syntax check.
I haven't done any tests with other databases than PostgreSQL but I suspect the probability for at least something being broken after an upgrade of adodb is 100% considering how much that have been changed in adodb in almost 15 years.
Upgrading adodb is a major step but imho it is the only viable solution in the long run to keep Gallery2 supportable going forward.
I will continue to work on this as time permits since it is a showstopper for upgrading from php 8.0 to php 8.1 when using PostgreSQL as the database.
I messed up the branching again but this has been applied in commit 0dfe2be. Closing.
Attempting to add a new item into an album gives the trace output below:
Error (ERROR_OBSOLETE_DATA) : UPDATE g2_Entity SET g_serialNumber=? WHERE g_id=? AND g_serialNumber=? (2|18472|1)
It looks like the SQL query somehow is run twice with the same values. A query in the database table shows that the row was successfully updated the first time.
Adding the item on FreeBSD 12.3 with PostgreSQL 12.13 and php 8.0.26 works without any problem but it fails on FreeBSD 12.3 with PostgreSQL 12.13 and php 8.1.13.