coppermine-gallery.com/forum

Support => cpg1.6.x Support => cpg1.6 install => Topic started by: andresf on April 29, 2026, 09:44:51 PM

Title: Possible bug creating hit_stats table
Post by: andresf on April 29, 2026, 09:44:51 PM
Hello:

My name is Andres and this is my first message in this forum. I want to thank André for his help with some problems I had registering.

I discovered the Coppermine Gallery a while ago and have some experience programming it. I hope I can contribute something to improve this tool.

In this post, I wanted to warn about a possible bug in the sql\schema.sql file. When the "hit_stats" table is created, the `pid` field should be of type INT, according to the documentation, not VARCHAR(100). This can be found on line 196.

Regards
Title: Re: Possible bug creating hit_stats table
Post by: ron4mac on April 30, 2026, 02:35:12 AM
Thank you for posting your discovery. Technically, you are correct. But it has been mis-declared like that for over 18 years without issue.
Title: Re: Possible bug creating hit_stats table
Post by: andresf on April 30, 2026, 02:33:15 PM
Thanks, ron4mac, for your reply. Indeed, it's not really a "bug" that affects the gallery's functionality.

I realized this when I saw that the "hit_stats" table is possibly the one that grows the most and takes up the most space in the database, and that field ('pid') declared as VARCHAR(100) contributes to it taking up even more space.
Title: Re: Possible bug creating hit_stats table
Post by: andresf on April 30, 2026, 02:50:57 PM
Well, it doesn't really take up much more space; the VARCHAR type adjusts the space to the entered data.