gregstoll / gallery2

A fork of the Gallery project (galleryproject.org) that supports PHP 8
GNU General Public License v2.0
44 stars 24 forks source link

ImageBlock plugin broken after adodb upgrade when using PostgreSQL as database #143

Closed kaeni1Ohkohd closed 1 year ago

kaeni1Ohkohd commented 1 year ago

After the adodb upgrade the ImageBlock plugin throws an SQL error when using PostgreSQL as database due to a typecast mismatch. The error message is 'ERROR: column "g_userid" is of type integer but expression is of type text at character 59'. The root cause seems to be change in how adodb and/or PostgreSQL handles implicit typecasting.

I have attached a patch that solves the issue and as far as I can tell after tests, it also works when using MySQL/mariadb as database. I am not entirely happy with the patch since it might break the compatibility with other databases than pgsql/mysql/mariadb but without it the ImageBlock plugin does not work at all with PostgreSQL.

If the patch is accepted it also solves issue 123.

imageblock.txt

gregstoll commented 1 year ago

Thanks a bunch! Can confirm this works fine with MySQL/mariadb, and it seems like this follows general SQL usage.

I messed up the branching again but this has been applied in commit 0dfe2be. Closing.